From ahughes at redhat.com Fri Jun 1 04:31:26 2012 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Jun 2012 12:31:26 +0100 Subject: Reviewer needed: small patch for a LETypes.h + "6501644: sync LayoutEngine *code* structure to match ICU" for IcedTea6 HEAD In-Reply-To: <4FC78EA6.6070709@redhat.com> References: <4FC78EA6.6070709@redhat.com> Message-ID: <20120601113125.GA10601@rivendell.middle-earth.co.uk> On 17:30 Thu 31 May , Pavel Tisnovsky wrote: > Hi, > > to be able to backport "6886358: layout code update" (== fix for PR1018) into > IcedTea6 HEAD it is needed to synchronize OpenJDK6 sources with OpenJDK7. > > To do that the "6501644: sync LayoutEngine *code* structure to match ICU" should > be backported to IcedTea6 HEAD + I added a small patch for a header file > LETypes.h to allow the patch to be applied cleanly. > > Can anybody please review this small fix + backport of "6501644: sync LayoutEngine *code* structure to match ICU" > into IcedTea6 HEAD? It's been tested w/o problems ATM. > > ChangeLog entry: > > 2012-05-31 Pavel Tisnovsky > > * patches/letypes-header.patch: > Fix for the header file LETypes.h to allow the following patch > to be applied cleanly. > * patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch: > 6501644: sync LayoutEngine *code* structure to match ICU > * Makefile.am: Updated. > > > > Cheers, > Pavel Where does the LETypes.h patch come from and why is it needed? Does 7 not need it too? > diff -r aaefc2cbbc10 Makefile.am > --- a/Makefile.am Wed May 16 12:59:46 2012 +0100 > +++ b/Makefile.am Thu May 31 17:27:49 2012 +0200 > @@ -417,7 +417,9 @@ > patches/openjdk/p11cipher-6867345-turkish_regional_options_cause_npe_in_algoid.patch \ > patches/openjdk/p11cipher-6687725-throw_illegalblocksizeexception.patch \ > patches/openjdk/p11cipher-6924489-ckr_operation_not_initialized.patch \ > - patches/openjdk/p11cipher-6604496-support_ckm_aes_ctr.patch > + patches/openjdk/p11cipher-6604496-support_ckm_aes_ctr.patch \ > + patches/letypes-header.patch \ > + patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch > > if WITH_RHINO > ICEDTEA_PATCHES += \ > diff -r aaefc2cbbc10 patches/letypes-header.patch > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/patches/letypes-header.patch Thu May 31 17:27:49 2012 +0200 > @@ -0,0 +1,13 @@ > +diff -r 019908df0313 -r 1bbbd0ef5d04 src/share/native/sun/font/layout/LETypes.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LETypes.h Thu May 28 18:11:07 2009 +0400 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LETypes.h Sat Jun 13 06:43:54 2009 +0900 > +@@ -36,7 +36,8 @@ > + #define LE_USE_CMEMORY > + > + #ifdef LE_USE_CMEMORY > +-#include "cmemory.h" > ++#include > ++#include > + #endif > + > + #ifndef _LP64 > diff -r aaefc2cbbc10 patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch Thu May 31 17:27:49 2012 +0200 > @@ -0,0 +1,8062 @@ > +# HG changeset patch > +# User srl > +# Date 1254258373 25200 > +# Node ID c74d38ef118c45d1d5a077e1917243d52829a8e4 > +# Parent 27d58a02bb9de7f8a7aab869079f7cd4ef3b5214 > +6501644: sync LayoutEngine *code* structure to match ICU > +Reviewed-by: prr > + > +diff -r 27d58a02bb9d -r c74d38ef118c make/sun/font/Makefile > +--- openjdk.orig/jdk/make/sun/font/Makefile Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/make/sun/font/Makefile Tue Sep 29 14:06:13 2009 -0700 > +@@ -199,3 +199,7 @@ > + CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows > + endif > + > ++# Make the Layout Engine build standalone > ++CPPFLAGS += -DLE_STANDALONE > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AlternateSubstSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 AlternateSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const > + { > + // NOTE: For now, we'll just pick the first alternative... > +@@ -64,3 +66,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AlternateSubstSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __ALTERNATESUBSTITUTIONSUBTABLES_H > + #define __ALTERNATESUBSTITUTIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "OpenTypeTables.h" > + #include "GlyphSubstitutionTables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct AlternateSetTable > + { > + le_uint16 glyphCount; > +@@ -52,4 +59,5 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AnchorTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AnchorTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/AnchorTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "AnchorTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + void AnchorTable::getAnchor(LEGlyphID glyphID, const LEFontInstance *fontInstance, > + LEPoint &anchor) const > + { > +@@ -124,3 +126,6 @@ > + > + fontInstance->pixelsToUnits(pixels, anchor); > + } > ++ > ++U_NAMESPACE_END > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AnchorTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AnchorTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/AnchorTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,10 +32,17 @@ > + #ifndef __ANCHORTABLES_H > + #define __ANCHORTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct AnchorTable > + { > + le_uint16 anchorFormat; > +@@ -66,5 +73,7 @@ > + void getAnchor(const LEFontInstance *fontInstance, LEPoint &anchor) const; > + }; > + > ++U_NAMESPACE_END > ++#endif > + > +-#endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -49,23 +49,25 @@ > + #include "ArabicShaping.h" > + #include "CanonShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_bool CharSubstitutionFilter::accept(LEGlyphID glyph) const > + { > + return fFontInstance->canDisplay((LEUnicode) glyph); > + } > + > +-ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine( > +- const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ArabicOpenTypeLayoutEngine) > ++ > ++ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) > + { > + fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); > + fFeatureOrder = TRUE; > + } > + > +-ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine( > +- const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags) > + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) > + { > + fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); > +@@ -86,9 +88,8 @@ > + // Input: characters > + // Output: characters, char indices, tags > + // Returns: output character count > +-le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -124,8 +125,8 @@ > + return count; > + } > + > +-void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -137,24 +138,20 @@ > + } > + > + if (fGPOSTable != NULL) { > +- OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count, > +- reverse, glyphStorage, success); > ++ OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success); > + } else if (fGDEFTable != NULL) { > + GDEFMarkFilter filter(fGDEFTable); > + > + adjustMarkGlyphs(glyphStorage, &filter, success); > + } else { > +- GlyphDefinitionTableHeader *gdefTable = > +- (GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable; > ++ GlyphDefinitionTableHeader *gdefTable = (GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable; > + GDEFMarkFilter filter(gdefTable); > + > + adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success); > + } > + } > + > +-UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine( > +- const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > + : ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) > + { > + fGSUBTable = (const GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; > +@@ -169,8 +166,7 @@ > + } > + > + // "glyphs", "indices" -> glyphs, indices > +-le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing( > +- LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -193,17 +189,14 @@ > + > + glyphStorage.adoptCharIndicesArray(tempGlyphStorage); > + > +- ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE, > +- TRUE, glyphStorage, success); > ++ ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE, TRUE, glyphStorage, success); > + > + LE_DELETE_ARRAY(tempChars); > + > + return tempGlyphCount; > + } > + > +-void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -228,9 +221,8 @@ > + } > + } > + > +-void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_bool reverse, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -245,3 +237,6 @@ > + > + adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success); > + } > ++ > ++U_NAMESPACE_END > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -43,6 +43,8 @@ > + #include "GlyphDefinitionTables.h" > + #include "GlyphPositioningTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /** > + * This class implements OpenType layout for Arabic fonts. It overrides > + * the characerProcessing method to assign the correct OpenType feature > +@@ -71,8 +73,8 @@ > + * > + * @internal > + */ > +- ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > ++ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > + > + /** > + * This constructor is used when the font requires a "canned" GSUB table which can't be known > +@@ -87,8 +89,8 @@ > + * > + * @internal > + */ > +- ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, le_int32 typoFlags); > ++ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -97,6 +99,20 @@ > + */ > + virtual ~ArabicOpenTypeLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + > + /** > +@@ -108,8 +124,7 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in a > +- * right to left directional run > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > + * > + * Output parameters: > + * @param outChars - the output character arrayt > +@@ -121,9 +136,8 @@ > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method applies the GPOS table if it is present, otherwise it ensures that all vowel > +@@ -142,11 +156,9 @@ > + * > + * @internal > + */ > +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > +- // static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, > +- // le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ // static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + }; > + > +@@ -178,8 +190,8 @@ > + * > + * @internal > + */ > +- UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > ++ UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -208,8 +220,7 @@ > + * > + * @internal > + */ > +- virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method copies the input characters into the output glyph index array, > +@@ -227,8 +238,7 @@ > + * > + * @internal > + */ > +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, le_bool mirror, > ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, > + LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +@@ -245,8 +255,9 @@ > + * > + * @internal > + */ > +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicShaping.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "LEGlyphStorage.h" > + #include "ClassDefinitionTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // This table maps Unicode joining types to > + // ShapeTypes. > + const ArabicShaping::ShapeType ArabicShaping::shapeTypes[] = > +@@ -102,9 +104,7 @@ > + #define markFeatureMask 0x00040000UL > + #define mkmkFeatureMask 0x00020000UL > + > +-#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | \ > +- markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | \ > +- dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask) > ++#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask) > + > + #define SHAPE_MASK 0xF0000000UL > + > +@@ -226,3 +226,5 @@ > + adjustTags(erout, 2, glyphStorage); > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicShaping.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicShaping.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicShaping.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __ARABICSHAPING_H > + #define __ARABICSHAPING_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > +-class ArabicShaping { > ++class ArabicShaping /* not : public UObject because all methods are static */ { > + public: > + // Joining types > + enum JoiningTypes > +@@ -74,8 +81,8 @@ > + > + typedef le_int32 ShapeType; > + > +- static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, > +- le_int32 charMax, le_bool rightToLeft, LEGlyphStorage &glyphStorage); > ++ static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax, > ++ le_bool rightToLeft, LEGlyphStorage &glyphStorage); > + > + static const FeatureMap *getFeatureMap(le_int32 &count); > + > +@@ -88,8 +95,8 @@ > + static const le_uint8 shapingTypeTable[]; > + static const ShapeType shapeTypes[]; > + > +- static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, > +- LEGlyphStorage &glyphStorage); > ++ static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage); > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AttachmentPosnSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AttachmentPosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/AttachmentPosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __ATTACHMENTPOSITIONINGSUBTABLES_H > + #define __ATTACHMENTPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "GlyphPositioningTables.h" > + #include "ValueRecords.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct AttachmentPositioningSubtable : GlyphPositioningSubtable > + { > + Offset baseCoverageTableOffset; > +@@ -55,4 +62,6 @@ > + return getGlyphCoverage(baseCoverageTableOffset, baseGlyphID); > + } > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonData.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonData.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonData.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,8 @@ > + #include "LETypes.h" > + #include "CanonShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const le_uint8 CanonShaping::glyphSubstitutionTable[] = { > + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x58, 0x02, 0x86, 0x00, 0x12, 0x61, 0x72, 0x61, 0x62, > + 0x00, 0x6E, 0x62, 0x65, 0x6E, 0x67, 0x00, 0x82, 0x63, 0x79, 0x72, 0x6C, 0x00, 0x8E, 0x64, 0x65, > +@@ -3773,3 +3775,5 @@ > + 0x00, 0xDC, 0xD1, 0x85, 0xD1, 0x89, 0x00, 0xE6, 0xD1, 0x8A, 0xD1, 0x8B, 0x00, 0xDC, 0xD1, 0xAA, > + 0xD1, 0xAD, 0x00, 0xE6, 0xD2, 0x42, 0xD2, 0x44, 0x00, 0xE6 > + }; > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonShaping.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonShaping.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonShaping.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,8 +35,9 @@ > + #include "GlyphDefinitionTables.h" > + #include "ClassDefinitionTables.h" > + > +-void CanonShaping::sortMarks(le_int32 *indices, > +- const le_int32 *combiningClasses, le_int32 index, le_int32 limit) > ++U_NAMESPACE_BEGIN > ++ > ++void CanonShaping::sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit) > + { > + for (le_int32 j = index + 1; j < limit; j += 1) { > + le_int32 i; > +@@ -55,13 +56,11 @@ > + } > + } > + > +-void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, > +- le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage) > ++void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft, > ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage) > + { > +- const GlyphDefinitionTableHeader *gdefTable = > +- (const GlyphDefinitionTableHeader *) glyphDefinitionTable; > +- const ClassDefinitionTable *classTable = > +- gdefTable->getMarkAttachClassDefinitionTable(); > ++ const GlyphDefinitionTableHeader *gdefTable = (const GlyphDefinitionTableHeader *) glyphDefinitionTable; > ++ const ClassDefinitionTable *classTable = gdefTable->getMarkAttachClassDefinitionTable(); > + le_int32 *combiningClasses = LE_NEW_ARRAY(le_int32, charCount); > + le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount); > + LEErrorCode status = LE_NO_ERROR; > +@@ -103,3 +102,5 @@ > + LE_DELETE_ARRAY(indices); > + LE_DELETE_ARRAY(combiningClasses); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonShaping.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonShaping.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonShaping.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,20 +34,22 @@ > + > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > +-class CanonShaping > ++class CanonShaping /* not : public UObject because all members are static */ > + { > + public: > + static const le_uint8 glyphSubstitutionTable[]; > + static const le_uint8 glyphDefinitionTable[]; > + > +- static void reorderMarks(const LEUnicode *inChars, le_int32 charCount, > +- le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage); > ++ static void reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft, > ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage); > + > + private: > +- static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses, > +- le_int32 index, le_int32 limit); > ++ static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit); > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CharSubstitutionFilter.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CharSubstitutionFilter.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CharSubstitutionFilter.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEFontInstance; > + > + /** > +@@ -43,7 +45,7 @@ > + * > + * @internal > + */ > +-class CharSubstitutionFilter : public LEGlyphFilter > ++class CharSubstitutionFilter : public UMemory, public LEGlyphFilter > + { > + private: > + /** > +@@ -98,4 +100,7 @@ > + le_bool accept(LEGlyphID glyph) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ClassDefinitionTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "ClassDefinitionTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_int32 ClassDefinitionTable::getGlyphClass(LEGlyphID glyphID) const > + { > + switch(SWAPW(classFormat)) { > +@@ -139,3 +141,5 @@ > + > + return FALSE; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ClassDefinitionTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __CLASSDEFINITIONTABLES_H > + #define __CLASSDEFINITIONTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct ClassDefinitionTable > + { > + le_uint16 classFormat; > +@@ -69,4 +76,5 @@ > + le_bool hasGlyphClass(le_int32 glyphClass) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphInsertion.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphInsertion.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphInsertion.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __CONTEXTUALGLYPHINSERTION_H > + #define __CONTEXTUALGLYPHINSERTION_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "StateTables.h" > + #include "MorphTables.h" > + #include "MorphStateTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct ContextualGlyphInsertionHeader : MorphStateTableHeader > + { > + }; > +@@ -60,4 +67,5 @@ > + ByteOffset markedInsertionListOffset; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ContextualGlyphSubstitutionProcessor) > ++ > + ContextualGlyphSubstitutionProcessor::ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader) > + : StateTableProcessor(morphSubtableHeader) > + { > +@@ -57,8 +61,7 @@ > + markGlyph = 0; > + } > + > +-ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, > +- le_int32 &currGlyph, EntryTableIndex index) > ++ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) > + { > + const ContextualGlyphSubstitutionStateEntry *entry = &entryTable[index]; > + ByteOffset newState = SWAPW(entry->newStateOffset); > +@@ -97,3 +100,5 @@ > + void ContextualGlyphSubstitutionProcessor::endStateTable() > + { > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstProc.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H > + #define __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "StateTableProcessor.h" > + #include "ContextualGlyphSubstitution.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class ContextualGlyphSubstitutionProcessor : public StateTableProcessor > +@@ -52,6 +59,20 @@ > + ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader); > + virtual ~ContextualGlyphSubstitutionProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + ContextualGlyphSubstitutionProcessor(); > + > +@@ -62,6 +83,8 @@ > + le_int32 markGlyph; > + > + const ContextualGlyphSubstitutionHeader *contextualGlyphSubstitutionHeader; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstitution.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstitution.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstitution.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,18 @@ > + #ifndef __CONTEXTUALGLYPHSUBSTITUTION_H > + #define __CONTEXTUALGLYPHSUBSTITUTION_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "StateTables.h" > + #include "MorphTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct ContextualGlyphSubstitutionHeader : MorphStateTableHeader > + { > + ByteOffset substitutionTableOffset; > +@@ -55,4 +62,5 @@ > + WordOffset currOffset; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualSubstSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -39,6 +38,8 @@ > + #include "CoverageTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /* > + NOTE: This could be optimized somewhat by keeping track > + of the previous sequenceIndex in the loop and doing next() > +@@ -350,7 +351,7 @@ > + > + // NOTE: This could be a #define, but that seems to confuse > + // the Visual Studio .NET 2003 compiler on the calls to the > +-// GlyphIterator constructor. It somehow can't decide if > ++// GlyphIterator constructor. It somehow can't decide if > + // emptyFeatureList matches an le_uint32 or an le_uint16... > + static const FeatureMask emptyFeatureList = 0x00000000UL; > + > +@@ -542,3 +543,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualSubstSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __CONTEXTUALSUBSTITUTIONSUBTABLES_H > + #define __CONTEXTUALSUBSTITUTIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "GlyphIterator.h" > + #include "LookupProcessor.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct SubstitutionLookupRecord > + { > + le_uint16 sequenceIndex; > +@@ -218,4 +225,5 @@ > + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CoverageTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CoverageTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CoverageTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "CoverageTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_int32 CoverageTable::getGlyphCoverage(LEGlyphID glyphID) const > + { > + switch(SWAPW(coverageFormat)) > +@@ -106,3 +108,5 @@ > + > + return startCoverageIndex + (ttGlyphID - firstInRange); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CoverageTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CoverageTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CoverageTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __COVERAGETABLES_H > + #define __COVERAGETABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct CoverageTable > + { > + le_uint16 coverageFormat; > +@@ -58,5 +65,5 @@ > + le_int32 getGlyphCoverage(LEGlyphID glyphID) const; > + }; > + > +- > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,8 @@ > + #include "OpenTypeUtilities.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const > + { > + LEGlyphID glyphID = glyphIterator->getCurrGlyphID(); > +@@ -68,3 +70,5 @@ > + > + return 1; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CursiveAttachmentSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,10 +32,17 @@ > + #ifndef __CURSIVEATTACHMENTSUBTABLES_H > + #define __CURSIVEATTACHMENTSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "GlyphPositioningTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEFontInstance; > + class GlyphIterator; > + > +@@ -53,4 +60,7 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DefaultCharMapper.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DefaultCharMapper.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/DefaultCharMapper.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,9 +31,16 @@ > + #ifndef __DEFAULTCHARMAPPER_H > + #define __DEFAULTCHARMAPPER_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /** > + * This class is an instance of LECharMapper which > + * implements control character filtering and bidi > +@@ -42,7 +48,7 @@ > + * > + * @see LECharMapper > + */ > +-class DefaultCharMapper : public LECharMapper > ++class DefaultCharMapper : public UMemory, public LECharMapper > + { > + private: > + le_bool fFilterControls; > +@@ -77,4 +83,5 @@ > + LEUnicode32 mapChar(LEUnicode32 ch) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DeviceTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DeviceTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/DeviceTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved > + * > + */ > +@@ -34,6 +35,8 @@ > + #include "DeviceTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const le_uint16 DeviceTable::fieldMasks[] = {0x0003, 0x000F, 0x00FF}; > + const le_uint16 DeviceTable::fieldSignBits[] = {0x0002, 0x0008, 0x0080}; > + const le_uint16 DeviceTable::fieldBits[] = { 2, 4, 8}; > +@@ -62,3 +65,5 @@ > + > + return result; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DeviceTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DeviceTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/DeviceTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,10 +33,15 @@ > + #ifndef __DEVICETABLES_H > + #define __DEVICETABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > +-#include "GlyphIterator.h" > +-#include "GlyphPositionAdjustments.h" > ++ > ++U_NAMESPACE_BEGIN > + > + struct DeviceTable > + { > +@@ -52,5 +58,7 @@ > + static const le_uint16 fieldBits[]; > + }; > + > ++U_NAMESPACE_END > ++#endif > + > +-#endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ExtensionSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,7 +25,8 @@ > + > + /* > + * > +- * (C) Copyright IBM Corp. 2003 - All Rights Reserved > ++ * > ++ * (C) Copyright IBM Corp. 2002 - All Rights Reserved > + * > + */ > + > +@@ -37,6 +38,9 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++ > + // FIXME: should look at the format too... maybe have a sub-class for it? > + le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, > + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const > +@@ -52,3 +56,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ExtensionSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 2002-2003 - All Rights Reserved > + * > + */ > +@@ -32,12 +33,19 @@ > + #ifndef __EXTENSIONSUBTABLES_H > + #define __EXTENSIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "GlyphSubstitutionTables.h" > + #include "LookupProcessor.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct ExtensionSubtable //: GlyphSubstitutionSubtable > + { > + le_uint16 substFormat; > +@@ -48,4 +56,5 @@ > + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Features.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Features.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/Features.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved > + * > + */ > +@@ -35,6 +36,8 @@ > + #include "Features.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const FeatureTable *FeatureListTable::getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const > + { > + if (featureIndex >= SWAPW(featureCount)) { > +@@ -79,3 +82,5 @@ > + return 0; > + #endif > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Features.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Features.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/Features.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __FEATURES_H > + #define __FEATURES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct FeatureRecord > + { > + ATag featureTag; > +@@ -53,9 +60,10 @@ > + le_uint16 featureCount; > + FeatureRecord featureRecordArray[ANY_NUMBER]; > + > +- const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; > ++ const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; > + > + const FeatureTable *getFeatureTable(LETag featureTag) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GDEFMarkFilter.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "GDEFMarkFilter.h" > + #include "GlyphDefinitionTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + GDEFMarkFilter::GDEFMarkFilter(const GlyphDefinitionTableHeader *gdefTable) > + { > + classDefTable = gdefTable->getGlyphClassDefinitionTable(); > +@@ -50,3 +52,5 @@ > + > + return glyphClass == gcdMarkGlyph; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GDEFMarkFilter.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,18 @@ > + #ifndef __GDEFMARKFILTER__H > + #define __GDEFMARKFILTER__H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "GlyphDefinitionTables.h" > + > +-class GDEFMarkFilter : public LEGlyphFilter > ++U_NAMESPACE_BEGIN > ++ > ++class GDEFMarkFilter : public UMemory, public LEGlyphFilter > + { > + private: > + const GlyphClassDefinitionTable *classDefTable; > +@@ -51,5 +58,5 @@ > + virtual le_bool accept(LEGlyphID glyph) const; > + }; > + > +- > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GXLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,6 +23,7 @@ > + * > + */ > + > ++ > + /* > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > +@@ -36,8 +37,11 @@ > + > + #include "MorphTables.h" > + > +-GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, const MorphTableHeader *morphTable) > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine) > ++ > ++GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable) > + : LayoutEngine(fontInstance, scriptCode, languageCode, 0), fMorphTable(morphTable) > + { > + // nothing else to do? > +@@ -49,9 +53,7 @@ > + } > + > + // apply 'mort' table > +-le_int32 GXLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, > +- LEErrorCode &success) > ++le_int32 GXLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -74,9 +76,8 @@ > + } > + > + // apply positional tables > +-void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_bool /*reverse*/, > +- LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success) > ++void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool /*reverse*/, > ++ LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -89,3 +90,5 @@ > + > + // FIXME: no positional processing yet... > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GXLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,6 +23,7 @@ > + * > + */ > + > ++ > + /* > + * > + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved > +@@ -37,6 +38,8 @@ > + > + #include "MorphTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEFontInstance; > + class LEGlyphStorage; > + > +@@ -70,8 +73,7 @@ > + * > + * @internal > + */ > +- GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, const MorphTableHeader *morphTable); > ++ GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -80,6 +82,20 @@ > + */ > + virtual ~GXLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + > + /** > +@@ -99,10 +115,8 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the text is in a > +- * right to left directional run > +- * @param glyphStorage - the glyph storage object. The glyph > +- * and char index arrays will be set. > ++ * @param rightToLeft - TRUE if the text is in a right to left directional run > ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -111,8 +125,7 @@ > + * > + * @internal > + */ > +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > + LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +@@ -120,16 +133,18 @@ > + * 'kern', 'trak', 'bsln', 'opbd' and 'just' tables. > + * > + * Input parameters: > +- * @param glyphStorage - the object holding the glyph storage. > +- * The positions will be updated as needed. > ++ * @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > + * > + * @internal > + */ > +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphDefinitionTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "GlyphDefinitionTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const GlyphClassDefinitionTable *GlyphDefinitionTableHeader::getGlyphClassDefinitionTable() const > + { > + return (const GlyphClassDefinitionTable *) ((char *) this + SWAPW(glyphClassDefOffset)); > +@@ -53,3 +55,5 @@ > + { > + return (const MarkAttachClassDefinitionTable *) ((char *) this + SWAPW(MarkAttachClassDefOffset)); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphDefinitionTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,10 +32,17 @@ > + #ifndef __GLYPHDEFINITIONTABLES_H > + #define __GLYPHDEFINITIONTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "ClassDefinitionTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + typedef ClassDefinitionTable GlyphClassDefinitionTable; > + > + enum GlyphClassDefinitions > +@@ -110,4 +117,5 @@ > + const MarkAttachClassDefinitionTable *getMarkAttachClassDefinitionTable() const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphIterator.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,11 +38,10 @@ > + #include "Lookups.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > + > +-GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, > +- GlyphPositionAdjustments *theGlyphPositionAdjustments, > +- le_bool rightToLeft, le_uint16 theLookupFlags, FeatureMask theFeatureMask, > +- const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader) > ++GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, > ++ FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader) > + : direction(1), position(-1), nextLimit(-1), prevLimit(-1), > + glyphStorage(theGlyphStorage), glyphPositionAdjustments(theGlyphPositionAdjustments), > + srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), > +@@ -262,8 +261,8 @@ > + glyphPositionAdjustments->setBaseOffset(position, baseOffset); > + } > + > +-void GlyphIterator::adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, > +- float yPlacementAdjust, float xAdvanceAdjust, float yAdvanceAdjust) > ++void GlyphIterator::adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust, > ++ float xAdvanceAdjust, float yAdvanceAdjust) > + { > + if (direction < 0) { > + if (position <= nextLimit || position >= prevLimit) { > +@@ -281,8 +280,8 @@ > + glyphPositionAdjustments->adjustYAdvance(position, yAdvanceAdjust); > + } > + > +-void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, > +- float yPlacementAdjust, float xAdvanceAdjust, float yAdvanceAdjust) > ++void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust, > ++ float xAdvanceAdjust, float yAdvanceAdjust) > + { > + if (direction < 0) { > + if (position <= nextLimit || position >= prevLimit) { > +@@ -484,10 +483,11 @@ > + > + do { > + newPosition -= direction; > +- } while (newPosition != prevLimit && glyphStorage[newPosition] != 0xFFFE && > +- filterGlyph(newPosition)); > ++ } while (newPosition != prevLimit && glyphStorage[newPosition] != 0xFFFE && filterGlyph(newPosition)); > + > + position = newPosition; > + > + return position != prevLimit; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphIterator.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphIterator.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphIterator.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,26 +32,24 @@ > + #ifndef __GLYPHITERATOR_H > + #define __GLYPHITERATOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "GlyphDefinitionTables.h" > + > +-struct InsertionRecord > +-{ > +- InsertionRecord *next; > +- le_int32 position; > +- le_int32 count; > +- LEGlyphID glyphs[ANY_NUMBER]; > +-}; > ++U_NAMESPACE_BEGIN > + > + class LEGlyphStorage; > + class GlyphPositionAdjustments; > + > +-class GlyphIterator { > ++class GlyphIterator : public UMemory { > + public: > +- GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, > +- le_bool rightToLeft, le_uint16 theLookupFlags, FeatureMask theFeatureMask, > +- const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader); > ++ GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, > ++ FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader); > + > + GlyphIterator(GlyphIterator &that); > + > +@@ -122,4 +120,5 @@ > + GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphLookupTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphLookupTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphLookupTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "GlyphLookupTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_bool GlyphLookupTableHeader::coversScript(LETag scriptTag) const > + { > + const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset)); > +@@ -51,3 +53,5 @@ > + // Note: don't have to SWAPW langSysTable->featureCount to check for non-zero. > + return langSysTable != NULL && langSysTable->featureCount != 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphLookupTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphLookupTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphLookupTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __GLYPHLOOKUPTABLES_H > + #define __GLYPHLOOKUPTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct GlyphLookupTableHeader > + { > + fixed32 version; > +@@ -46,4 +53,7 @@ > + le_bool coversScriptAndLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch = FALSE) const; > + }; > + > ++U_NAMESPACE_END > ++ > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "LEGlyphStorage.h" > + #include "LEFontInstance.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define CHECK_ALLOCATE_ARRAY(array, type, size) \ > + if (array == NULL) { \ > + array = (type *) new type[size]; \ > +@@ -185,3 +187,5 @@ > + > + return NULL; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositionAdjustments.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,16 +32,23 @@ > + #ifndef __GLYPHPOSITIONADJUSTMENTS_H > + #define __GLYPHPOSITIONADJUSTMENTS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + class LEFontInstance; > + > +-class GlyphPositionAdjustments > ++class GlyphPositionAdjustments : public UMemory > + { > + private: > +- class Adjustment { > ++ class Adjustment : public UMemory { > + public: > + > + inline Adjustment(); > +@@ -78,7 +85,7 @@ > + // allow copying of this class because all of its fields are simple types > + }; > + > +- class EntryExitPoint > ++ class EntryExitPoint : public UMemory > + { > + public: > + inline EntryExitPoint(); > +@@ -144,14 +151,11 @@ > + inline void adjustXAdvance(le_int32 index, float xAdjustment); > + inline void adjustYAdvance(le_int32 index, float yAdjustment); > + > +- void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, > +- le_bool baselineIsLogicalEnd); > +- void setExitPoint(le_int32 index, LEPoint &newExitPoint, > +- le_bool baselineIsLogicalEnd); > ++ void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd); > ++ void setExitPoint(le_int32 index, LEPoint &newExitPoint, le_bool baselineIsLogicalEnd); > + void setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd); > + > +- void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, > +- const LEFontInstance *fontInstance); > ++ void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, const LEFontInstance *fontInstance); > + }; > + > + inline GlyphPositionAdjustments::Adjustment::Adjustment() > +@@ -160,10 +164,8 @@ > + // nothing else to do! > + } > + > +-inline GlyphPositionAdjustments::Adjustment::Adjustment(float xPlace, float yPlace, > +- float xAdv, float yAdv, le_int32 baseOff) > +- : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv), > +- baseOffset(baseOff) > ++inline GlyphPositionAdjustments::Adjustment::Adjustment(float xPlace, float yPlace, float xAdv, float yAdv, le_int32 baseOff) > ++ : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv), baseOffset(baseOff) > + { > + // nothing else to do! > + } > +@@ -246,7 +248,7 @@ > + inline GlyphPositionAdjustments::EntryExitPoint::EntryExitPoint() > + : fFlags(0) > + { > +- fEntryPoint.fX = fEntryPoint.fY = fExitPoint.fX = fEntryPoint.fY = 0; > ++ fEntryPoint.fX = fEntryPoint.fY = fExitPoint.fX = fExitPoint.fY = 0; > + } > + > + inline GlyphPositionAdjustments::EntryExitPoint::~EntryExitPoint() > +@@ -264,12 +266,10 @@ > + return (fFlags & EEF_BASELINE_IS_LOGICAL_END) != 0; > + } > + > +-inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint( > +- LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) > ++inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) > + { > + if (baselineIsLogicalEnd) { > +- fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH | > +- EEF_BASELINE_IS_LOGICAL_END); > ++ fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); > + } else { > + fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH); > + } > +@@ -277,12 +277,10 @@ > + fEntryPoint = newEntryPoint; > + } > + > +-inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint( > +- LEPoint &newExitPoint, le_bool baselineIsLogicalEnd) > ++inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd) > + { > + if (baselineIsLogicalEnd) { > +- fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH | > +- EEF_BASELINE_IS_LOGICAL_END); > ++ fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); > + } else { > + fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH); > + } > +@@ -290,8 +288,7 @@ > + fExitPoint = newExitPoint; > + } > + > +-inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph( > +- le_bool baselineIsLogicalEnd) > ++inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph(le_bool baselineIsLogicalEnd) > + { > + if (baselineIsLogicalEnd) { > + fFlags |= (EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); > +@@ -386,4 +383,5 @@ > + return fEntryExitPoints != NULL; > + } > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositioningTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -40,18 +39,18 @@ > + #include "LEGlyphStorage.h" > + #include "GlyphPositionAdjustments.h" > + > +-void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, > +- GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, > +- LETag scriptTag, LETag languageTag, > +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEFontInstance *fontInstance, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const > ++U_NAMESPACE_BEGIN > ++ > ++void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, > ++ LETag scriptTag, LETag languageTag, > ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > ++ const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const > + { > +- GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, > +- featureMapCount, featureOrder); > ++ GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, featureMapCount, featureOrder); > + > +- processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, > +- glyphDefinitionTableHeader, fontInstance); > ++ processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, glyphDefinitionTableHeader, fontInstance); > + > + glyphPositionAdjustments->applyCursiveAdjustments(glyphStorage, rightToLeft, fontInstance); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositioningTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,11 +31,18 @@ > + #ifndef __GLYPHPOSITIONINGTABLES_H > + #define __GLYPHPOSITIONINGTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "Lookups.h" > + #include "GlyphLookupTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEFontInstance; > + class LEGlyphStorage; > + class LEGlyphFilter; > +@@ -45,12 +51,10 @@ > + > + struct GlyphPositioningTableHeader : public GlyphLookupTableHeader > + { > +- void process(LEGlyphStorage &glyphStorage, > +- GlyphPositionAdjustments *glyphPositionAdjustments, > ++ void process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, > + le_bool rightToLeft, LETag scriptTag, LETag languageTag, > + const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEFontInstance *fontInstance, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; > ++ const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; > + }; > + > + enum GlyphPositioningSubtableTypes > +@@ -68,4 +72,5 @@ > + > + typedef LookupSubtable GlyphPositioningSubtable; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved > + * > + */ > +@@ -50,6 +49,8 @@ > + #include "GlyphPosnLookupProc.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // Aside from the names, the contextual positioning subtables are > + // the same as the contextual substitution subtables. > + typedef ContextualSubstitutionSubtable ContextualPositioningSubtable; > +@@ -57,8 +58,7 @@ > + > + GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( > + const GlyphPositioningTableHeader *glyphPositioningTableHeader, > +- LETag scriptTag, LETag languageTag, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) > ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) > + : LookupProcessor( > + (char *) glyphPositioningTableHeader, > + SWAPW(glyphPositioningTableHeader->scriptListOffset), > +@@ -166,3 +166,5 @@ > + GlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor() > + { > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPosnLookupProc.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,6 +31,11 @@ > + #ifndef __GLYPHPOSITIONINGLOOKUPPROCESSOR_H > + #define __GLYPHPOSITIONINGLOOKUPPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -42,12 +46,13 @@ > + #include "GlyphIterator.h" > + #include "LookupProcessor.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class GlyphPositioningLookupProcessor : public LookupProcessor > + { > + public: > + GlyphPositioningLookupProcessor(const GlyphPositioningTableHeader *glyphPositioningTableHeader, > +- LETag scriptTag, LETag languageTag, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); > ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); > + > + virtual ~GlyphPositioningLookupProcessor(); > + > +@@ -63,4 +68,5 @@ > + GlyphPositioningLookupProcessor &operator=(const GlyphPositioningLookupProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -48,17 +48,17 @@ > + #include "GlyphSubstLookupProc.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor( > + const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, > +- LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) > ++ LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) > + : LookupProcessor( > + (char *) glyphSubstitutionTableHeader, > + SWAPW(glyphSubstitutionTableHeader->scriptListOffset), > + SWAPW(glyphSubstitutionTableHeader->featureListOffset), > + SWAPW(glyphSubstitutionTableHeader->lookupListOffset), > +- scriptTag, languageTag, featureMap, featureMapCount, featureOrder) > +- , fFilter(filter) > ++ scriptTag, languageTag, featureMap, featureMapCount, featureOrder), fFilter(filter) > + { > + // anything? > + } > +@@ -143,3 +143,5 @@ > + GlyphSubstitutionLookupProcessor::~GlyphSubstitutionLookupProcessor() > + { > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstLookupProc.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,6 +31,11 @@ > + #ifndef __GLYPHSUBSTITUTIONLOOKUPPROCESSOR_H > + #define __GLYPHSUBSTITUTIONLOOKUPPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "LEFontInstance.h" > +@@ -43,12 +47,13 @@ > + #include "GlyphIterator.h" > + #include "LookupProcessor.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class GlyphSubstitutionLookupProcessor : public LookupProcessor > + { > + public: > + GlyphSubstitutionLookupProcessor(const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, > +- LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, > +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); > ++ LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); > + > + virtual ~GlyphSubstitutionLookupProcessor(); > + > +@@ -65,4 +70,5 @@ > + GlyphSubstitutionLookupProcessor &operator=(const GlyphSubstitutionLookupProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -40,14 +40,15 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > +-le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, > +- le_bool rightToLeft, LETag scriptTag, LETag languageTag, > +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEGlyphFilter *filter, const FeatureMap *featureMap, > +- le_int32 featureMapCount, le_bool featureOrder) const > ++U_NAMESPACE_BEGIN > ++ > ++le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, > ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > ++ const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const > + { > +- GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, > +- featureMapCount, featureOrder); > ++ GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, featureMapCount, featureOrder); > + > + return processor.process(glyphStorage, NULL, rightToLeft, glyphDefinitionTableHeader, NULL); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstitutionTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,22 +32,27 @@ > + #ifndef __GLYPHSUBSTITUTIONTABLES_H > + #define __GLYPHSUBSTITUTIONTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + #include "Lookups.h" > + #include "GlyphLookupTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + class LEGlyphFilter; > + struct GlyphDefinitionTableHeader; > + > + struct GlyphSubstitutionTableHeader : public GlyphLookupTableHeader > + { > +- le_int32 process(LEGlyphStorage &glyphStorage, > +- le_bool rightToLeft, LETag scriptTag, LETag languageTag, > +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEGlyphFilter *filter, const FeatureMap *featureMap, > +- le_int32 featureMapCount, le_bool featureOrder) const; > ++ le_int32 process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, > ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEGlyphFilter *filter, > ++ const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; > + }; > + > + enum GlyphSubstitutionSubtableTypes > +@@ -64,4 +69,5 @@ > + > + typedef LookupSubtable GlyphSubstitutionSubtable; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/HanLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * HanLayoutEngine.cpp: OpenType processing for Han fonts. > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. > +@@ -41,6 +40,10 @@ > + #include "LEGlyphStorage.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(HanOpenTypeLayoutEngine) > ++ > + #define loclFeatureTag LE_LOCL_FEATURE_TAG > + #define smplFeatureTag LE_SMPL_FEATURE_TAG > + #define tradFeatureTag LE_TRAD_FEATURE_TAG > +@@ -60,9 +63,8 @@ > + > + #define features (loclFeatureMask) > + > +-HanOpenTypeLayoutEngine::HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- const GlyphSubstitutionTableHeader *gsubTable) > ++HanOpenTypeLayoutEngine::HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) > + { > + fFeatureMap = featureMap; > +@@ -74,9 +76,8 @@ > + // nothing to do > + } > + > +-le_int32 HanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, > +- LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 HanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, > ++ LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -104,3 +105,5 @@ > + > + return count; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/HanLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,8 +23,8 @@ > + * > + */ > + > ++ > + /* > +- * > + * HanLayoutEngine.h: OpenType processing for Han fonts. > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. > +@@ -40,6 +40,8 @@ > + > + #include "GlyphSubstitutionTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + /** > +@@ -69,9 +71,8 @@ > + * > + * @internal > + */ > +- HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, > +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > ++ HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > + > + > + /** > +@@ -81,6 +82,20 @@ > + */ > + virtual ~HanOpenTypeLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + > + /** > +@@ -92,10 +107,8 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in a > +- * right to left directional run > +- * @param glyphStorage - the object holding the glyph storage. The char > +- * index and auxillary data arrays will be set. > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > ++ * @param glyphStorage - the object holding the glyph storage. The char index and auxillary data arrays will be set. > + * > + * Output parameters: > + * @param outChars - the output character arrayt > +@@ -107,9 +120,10 @@ > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicClassTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "OpenTypeUtilities.h" > + #include "IndicReordering.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // Split matra table indices > + #define _x1 (1 << CF_INDEX_SHIFT) > + #define _x2 (2 << CF_INDEX_SHIFT) > +@@ -385,3 +387,5 @@ > + > + return classTable->getWorstCaseExpansion(); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -45,20 +45,20 @@ > + > + #include "IndicReordering.h" > + > +-IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- const GlyphSubstitutionTableHeader *gsubTable) > +- : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable), > +- fMPreFixups(NULL) > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicOpenTypeLayoutEngine) > ++ > ++IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > ++ : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable), fMPreFixups(NULL) > + { > + fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); > + fFeatureOrder = TRUE; > + } > + > +-IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > +- : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), > +- fMPreFixups(NULL) > ++IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++ : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fMPreFixups(NULL) > + { > + fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); > + fFeatureOrder = TRUE; > +@@ -71,9 +71,8 @@ > + > + // Input: characters, tags > + // Output: glyphs, char indices > +-le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -84,8 +83,7 @@ > + return 0; > + } > + > +- le_int32 retCount = OpenTypeLayoutEngine::glyphProcessing(chars, offset, count, max, > +- rightToLeft, glyphStorage, success); > ++ le_int32 retCount = OpenTypeLayoutEngine::glyphProcessing(chars, offset, count, max, rightToLeft, glyphStorage, success); > + > + if (LE_FAILURE(success)) { > + return 0; > +@@ -99,9 +97,8 @@ > + // Input: characters > + // Output: characters, char indices, tags > + // Returns: output character count > +-le_int32 IndicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 IndicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -131,9 +128,10 @@ > + > + // NOTE: assumes this allocates featureTags... > + // (probably better than doing the worst case stuff here...) > +- le_int32 outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, > +- outChars, glyphStorage, &fMPreFixups); > ++ le_int32 outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups); > ++ > + glyphStorage.adoptGlyphCount(outCharCount); > +- > + return outCharCount; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -43,6 +43,8 @@ > + #include "GlyphDefinitionTables.h" > + #include "GlyphPositioningTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class MPreFixups; > + class LEGlyphStorage; > + > +@@ -77,9 +79,8 @@ > + * > + * @internal > + */ > +- IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, > +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > ++ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > + > + /** > + * This constructor is used when the font requires a "canned" GSUB table which can't be known > +@@ -94,8 +95,8 @@ > + * > + * @internal > + */ > +- IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > ++ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -104,6 +105,20 @@ > + */ > + virtual ~IndicOpenTypeLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + > + /** > +@@ -117,10 +132,9 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in a > +- * right to left directional run > +- * @param glyphStorage - the glyph storage object. The glyph and character > +- * index arrays will be set. The auxillary data array will be set to the feature tags. > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > ++ * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. > ++ * the auxillary data array will be set to the feature tags. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -129,9 +143,8 @@ > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method does character to glyph mapping, applies the GSUB table and applies > +@@ -147,11 +160,9 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in a > +- * right to left directional run > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > + * @param featureTags - the feature tag array > +- * @param glyphStorage - the glyph storage object. The glyph and char > +- * index arrays will be set. > ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -163,12 +174,14 @@ > + * > + * @internal > + */ > +- virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, > +- LEErrorCode &success); > ++ virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + private: > ++ > + MPreFixups *fMPreFixups; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangement.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangement.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangement.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __INDICREARRANGEMENT_H > + #define __INDICREARRANGEMENT_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "StateTables.h" > + #include "MorphTables.h" > + #include "MorphStateTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct IndicRearrangementSubtableHeader : MorphStateTableHeader > + { > + }; > +@@ -78,4 +85,6 @@ > + { > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicRearrangementProcessor) > ++ > + IndicRearrangementProcessor::IndicRearrangementProcessor(const MorphSubtableHeader *morphSubtableHeader) > + : StateTableProcessor(morphSubtableHeader) > + { > +@@ -56,8 +60,7 @@ > + lastGlyph = 0; > + } > + > +-ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphStorage, > +- le_int32 &currGlyph, EntryTableIndex index) > ++ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) > + { > + const IndicRearrangementStateEntry *entry = &entryTable[index]; > + ByteOffset newState = SWAPW(entry->newStateOffset); > +@@ -416,3 +419,5 @@ > + break; > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangementProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __INDICREARRANGEMENTPROCESSOR_H > + #define __INDICREARRANGEMENTPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "StateTableProcessor.h" > + #include "IndicRearrangement.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class IndicRearrangementProcessor : public StateTableProcessor > +@@ -54,12 +61,28 @@ > + IndicRearrangementProcessor(const MorphSubtableHeader *morphSubtableHeader); > + virtual ~IndicRearrangementProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + le_int32 firstGlyph; > + le_int32 lastGlyph; > + > + const IndicRearrangementStateEntry *entryTable; > + const IndicRearrangementSubtableHeader *indicRearrangementSubtableHeader; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicReordering.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,8 @@ > + #include "LEGlyphStorage.h" > + #include "MPreFixups.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define initFeatureTag LE_INIT_FEATURE_TAG > + #define nuktFeatureTag LE_NUKT_FEATURE_TAG > + #define akhnFeatureTag LE_AKHN_FEATURE_TAG > +@@ -71,7 +73,7 @@ > + #define distFeatureMask 0x00020000UL > + #define initFeatureMask 0x00010000UL > + > +-class ReorderingOutput { > ++class ReorderingOutput : public UMemory { > + private: > + le_int32 fOutIndex; > + LEUnicode *fOutChars; > +@@ -187,8 +189,7 @@ > + fOutIndex += 1; > + } > + > +- le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, > +- FeatureMask matraFeatures, le_bool wordStart) > ++ le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, FeatureMask matraFeatures, le_bool wordStart) > + { > + IndicClassTable::CharClass matraClass = classTable->getCharClass(matra); > + > +@@ -219,13 +220,12 @@ > + return FALSE; > + } > + > +- void noteVowelModifier(const IndicClassTable *classTable, LEUnicode vowelModifier, > +- le_uint32 vowelModifierIndex, FeatureMask vowelModifierFeatures) > ++ void noteVowelModifier(const IndicClassTable *classTable, LEUnicode vowelModifier, le_uint32 vowelModifierIndex, FeatureMask vowelModifierFeatures) > + { > + IndicClassTable::CharClass vmClass = classTable->getCharClass(vowelModifier); > + > + fVMIndex = vowelModifierIndex; > +- fVMFeatures = vowelModifierFeatures; > ++ fVMFeatures = vowelModifierFeatures; > + > + if (IndicClassTable::isVowelModifier(vmClass)) { > + switch (vmClass & CF_POS_MASK) { > +@@ -244,13 +244,12 @@ > + } > + } > + > +- void noteStressMark(const IndicClassTable *classTable, LEUnicode stressMark, > +- le_uint32 stressMarkIndex, FeatureMask stressMarkFeatures) > ++ void noteStressMark(const IndicClassTable *classTable, LEUnicode stressMark, le_uint32 stressMarkIndex, FeatureMask stressMarkFeatures) > + { > + IndicClassTable::CharClass smClass = classTable->getCharClass(stressMark); > + > + fSMIndex = stressMarkIndex; > +- fSMFeatures = stressMarkFeatures; > ++ fSMFeatures = stressMarkFeatures; > + > + if (IndicClassTable::isStressMark(smClass)) { > + switch (smClass & CF_POS_MASK) { > +@@ -360,9 +359,7 @@ > + }; > + > + // TODO: Find better names for these! > +-#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | \ > +- blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | \ > +- blwmFeatureMask | abvmFeatureMask | distFeatureMask) > ++#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | blwmFeatureMask | abvmFeatureMask | distFeatureMask) > + #define tagArray3 (pstfFeatureMask | tagArray4) > + #define tagArray2 (halfFeatureMask | tagArray3) > + #define tagArray1 (blwfFeatureMask | tagArray2) > +@@ -415,8 +412,7 @@ > + return featureMap; > + } > + > +-le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, > +- const LEUnicode *chars, le_int32 prev, le_int32 charCount) > ++le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) > + { > + le_int32 cursor = prev; > + le_int8 state = 0; > +@@ -752,3 +748,5 @@ > + delete mpreFixups; > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicReordering.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicReordering.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicReordering.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __INDICREORDERING_H > + #define __INDICREORDERING_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // Characters that get refered to by name... > + #define C_SIGN_ZWNJ 0x200C > + #define C_SIGN_ZWJ 0x200D > +@@ -140,7 +147,7 @@ > + static const IndicClassTable *getScriptClassTable(le_int32 scriptCode); > + }; > + > +-class IndicReordering { > ++class IndicReordering /* not : public UObject because all methods are static */ { > + public: > + static le_int32 getWorstCaseExpansion(le_int32 scriptCode); > + > +@@ -156,8 +163,7 @@ > + // do not instantiate > + IndicReordering(); > + > +- static le_int32 findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, > +- le_int32 prev, le_int32 charCount); > ++ static le_int32 findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount); > + > + }; > + > +@@ -305,4 +311,5 @@ > + return hasBelowBaseForm(getCharClass(ch)); > + } > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KernTable.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KernTable.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KernTable.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 2004-2005 - All Rights Reserved > + * > + */ > +@@ -39,6 +40,8 @@ > + > + #define DEBUG 0 > + > ++U_NAMESPACE_BEGIN > ++ > + struct PairInfo { > + le_uint32 key; // sigh, MSVC compiler gags on union here > + le_int16 value; // fword, kern value in funits > +@@ -191,6 +194,12 @@ > + float adjust = 0; > + for (int i = 1, e = storage.getGlyphCount(); i < e; ++i) { > + key = key << 16 | (storage[i] & 0xffff); > ++ > ++ // argh, to do a binary search, we need to have the pair list in sorted order > ++ // but it is not in sorted order on win32 platforms because of the endianness difference > ++ // so either I have to swap the element each time I examine it, or I have to swap > ++ // all the elements ahead of time and store them in the font > ++ > + const PairInfo* p = pairs; > + const PairInfo* tp = (const PairInfo*)(p + rangeShift); > + if (key > tp->key) { > +@@ -238,3 +247,6 @@ > + storage.adjustPosition(storage.getGlyphCount(), adjust, 0, success); > + } > + } > ++ > ++U_NAMESPACE_END > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KernTable.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KernTable.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KernTable.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 2004-2005 - All Rights Reserved > + * > + */ > +@@ -37,9 +38,12 @@ > + #endif > + > + #include "LETypes.h" > ++//#include "LEFontInstance.h" > ++//#include "LEGlyphStorage.h" > + > + #include > + > ++U_NAMESPACE_BEGIN > + struct PairInfo; > + class LEFontInstance; > + class LEGlyphStorage; > +@@ -67,4 +71,6 @@ > + void process(LEGlyphStorage& storage); > + }; > + > ++U_NAMESPACE_END > ++ > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,8 +23,8 @@ > + * > + */ > + > ++ > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + * This file is a modification of the ICU file IndicLayoutEngine.cpp > +@@ -38,17 +38,20 @@ > + #include "LEGlyphStorage.h" > + #include "KhmerReordering.h" > + > +-KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- const GlyphSubstitutionTableHeader *gsubTable) > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(KhmerOpenTypeLayoutEngine) > ++ > ++KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) > + { > + fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); > + fFeatureOrder = TRUE; > + } > + > +-KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags) > + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) > + { > + fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); > +@@ -63,16 +66,14 @@ > + // Input: characters > + // Output: characters, char indices, tags > + // Returns: output character count > +-le_int32 KhmerOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 KhmerOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || > +- offset >= max || offset + count > max) { > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > +@@ -96,9 +97,10 @@ > + > + // NOTE: assumes this allocates featureTags... > + // (probably better than doing the worst case stuff here...) > +- le_int32 outCharCount = KhmerReordering::reorder(&chars[offset], count, > +- fScriptCode, outChars, glyphStorage); > ++ le_int32 outCharCount = KhmerReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage); > + > + glyphStorage.adoptGlyphCount(outCharCount); > + return outCharCount; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,6 +23,7 @@ > + * > + */ > + > ++ > + /* > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > +@@ -45,19 +46,18 @@ > + // #include "GlyphDefinitionTables.h" > + // #include "GlyphPositioningTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // class MPreFixups; > + // class LEGlyphStorage; > + > + /** > + * This class implements OpenType layout for Khmer OpenType fonts, as > +- * specified by Microsoft in "Creating and Supporting OpenType Fonts > +- * for Khmer Scripts" > +- * (http://www.microsoft.com/typography/otspec/indicot/default.htm) > +- * TODO: change url > ++ * specified by Microsoft in "Creating and Supporting OpenType Fonts for > ++ * Khmer Scripts" (http://www.microsoft.com/typography/otspec/indicot/default.htm) TODO: change url > + * > +- * This class overrides the characterProcessing method to do Khmer > +- * character processing and reordering (See the MS spec. for more > +- * details) > ++ * This class overrides the characterProcessing method to do Khmer character processing > ++ * and reordering (See the MS spec. for more details) > + * > + * @internal > + */ > +@@ -65,11 +65,10 @@ > + { > + public: > + /** > +- * This is the main constructor. It constructs an instance of > +- * KhmerOpenTypeLayoutEngine for a particular font, script and > +- * language. It takes the GSUB table as a parameter since > +- * LayoutEngine::layoutEngineFactory has to read the GSUB table to > +- * know that it has an Khmer OpenType font. > ++ * This is the main constructor. It constructs an instance of KhmerOpenTypeLayoutEngine for > ++ * a particular font, script and language. It takes the GSUB table as a parameter since > ++ * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an > ++ * Khmer OpenType font. > + * > + * @param fontInstance - the font > + * @param scriptCode - the script > +@@ -82,14 +81,12 @@ > + * > + * @internal > + */ > +- KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- const GlyphSubstitutionTableHeader *gsubTable); > ++ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > + > + /** > +- * This constructor is used when the font requires a "canned" GSUB > +- * table which can't be known until after this constructor has > +- * been invoked. > ++ * This constructor is used when the font requires a "canned" GSUB table which can't be known > ++ * until after this constructor has been invoked. > + * > + * @param fontInstance - the font > + * @param scriptCode - the script > +@@ -100,8 +97,8 @@ > + * > + * @internal > + */ > +- KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > ++ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -110,25 +107,35 @@ > + */ > + virtual ~KhmerOpenTypeLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + > + /** > +- * This method does Khmer OpenType character processing. It > +- * assigns the OpenType feature tags to the characters, and may > +- * generate output characters which have been reordered. It may > +- * also split some vowels, resulting in more output characters > +- * than input characters. > ++ * This method does Khmer OpenType character processing. It assigns the OpenType feature > ++ * tags to the characters, and may generate output characters which have been reordered. > ++ * It may also split some vowels, resulting in more output characters than input characters. > + * > + * Input parameters: > + * @param chars - the input character context > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in > +- * a right to left directional run > +- * @param glyphStorage - the glyph storage object. The glyph and > +- * character index arrays will be set. the auxillary data array > +- * will be set to the feature tags. > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > ++ * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. > ++ * the auxillary data array will be set to the feature tags. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -137,9 +144,11 @@ > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerReordering.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,9 @@ > + #include "KhmerReordering.h" > + #include "LEGlyphStorage.h" > + > ++ > ++U_NAMESPACE_BEGIN > ++ > + // Characters that get refered to by name... > + enum > + { > +@@ -53,35 +56,23 @@ > + > + enum > + { > +- // simple classes, they are used in the statetable (in this file) > +- // to control the length of a syllable they are also used to know > +- // where a character should be placed (location in reference to > +- // the base character) and also to know if a character, when > +- // independtly displayed, should be displayed with a dotted-circle > +- // to indicate error in syllable construction > +- > ++ // simple classes, they are used in the statetable (in this file) to control the length of a syllable > ++ // they are also used to know where a character should be placed (location in reference to the base character) > ++ // and also to know if a character, when independtly displayed, should be displayed with a dotted-circle to > ++ // indicate error in syllable construction > + _xx = KhmerClassTable::CC_RESERVED, > +- _sa = KhmerClassTable::CC_SIGN_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE > +- | KhmerClassTable::CF_POS_ABOVE, > +- _sp = KhmerClassTable::CC_SIGN_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE > +- | KhmerClassTable::CF_POS_AFTER, > ++ _sa = KhmerClassTable::CC_SIGN_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_POS_ABOVE, > ++ _sp = KhmerClassTable::CC_SIGN_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE| KhmerClassTable::CF_POS_AFTER, > + _c1 = KhmerClassTable::CC_CONSONANT | KhmerClassTable::CF_CONSONANT, > + _c2 = KhmerClassTable::CC_CONSONANT2 | KhmerClassTable::CF_CONSONANT, > + _c3 = KhmerClassTable::CC_CONSONANT3 | KhmerClassTable::CF_CONSONANT, > +- _rb = KhmerClassTable::CC_ROBAT | KhmerClassTable::CF_POS_ABOVE > +- | KhmerClassTable::CF_DOTTED_CIRCLE, > +- _cs = KhmerClassTable::CC_CONSONANT_SHIFTER | KhmerClassTable::CF_DOTTED_CIRCLE > +- | KhmerClassTable::CF_SHIFTER, > +- _dl = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BEFORE > +- | KhmerClassTable::CF_DOTTED_CIRCLE, > +- _db = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BELOW > +- | KhmerClassTable::CF_DOTTED_CIRCLE, > +- _da = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_ABOVE > +- | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_ABOVE_VOWEL, > +- _dr = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_AFTER > +- | KhmerClassTable::CF_DOTTED_CIRCLE, > +- _co = KhmerClassTable::CC_COENG | KhmerClassTable::CF_COENG > +- | KhmerClassTable::CF_DOTTED_CIRCLE, > ++ _rb = KhmerClassTable::CC_ROBAT | KhmerClassTable::CF_POS_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE, > ++ _cs = KhmerClassTable::CC_CONSONANT_SHIFTER | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_SHIFTER, > ++ _dl = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BEFORE | KhmerClassTable::CF_DOTTED_CIRCLE, > ++ _db = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BELOW | KhmerClassTable::CF_DOTTED_CIRCLE, > ++ _da = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_ABOVE_VOWEL, > ++ _dr = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE, > ++ _co = KhmerClassTable::CC_COENG | KhmerClassTable::CF_COENG | KhmerClassTable::CF_DOTTED_CIRCLE, > + > + // split vowel > + _va = _da | KhmerClassTable::CF_SPLIT_VOWEL, > +@@ -90,13 +81,10 @@ > + > + > + // Character class tables > +- > +-// _xx character does not combine into syllable, such as numbers, > +-// puntuation marks, non-Khmer signs... > ++// _xx character does not combine into syllable, such as numbers, puntuation marks, non-Khmer signs... > + // _sa Sign placed above the base > + // _sp Sign placed after the base > +-// _c1 Consonant of type 1 or independent vowel (independent vowels > +-// behave as type 1 consonants) > ++// _c1 Consonant of type 1 or independent vowel (independent vowels behave as type 1 consonants) > + // _c2 Consonant of type 2 (only RO) > + // _c3 Consonant of type 3 > + // _rb Khmer sign robat u17CC. combining mark for subscript consonants > +@@ -105,13 +93,10 @@ > + // _db Dependent vowel placed below the base > + // _da Dependent vowel placed above the base > + // _dr Dependent vowel placed behind the base (right of the base) > +-// _co Khmer combining mark COENG u17D2, combines with the consonant > +-// or independent vowel following it to create a subscript consonant > +-// or independent vowel > +-// _va Khmer split vowel in wich the first part is before the base and > +-// the second one above the base > +-// _vr Khmer split vowel in wich the first part is before the base and > +-// the second one behind (right of) the base > ++// _co Khmer combining mark COENG u17D2, combines with the consonant or independent vowel following > ++// it to create a subscript consonant or independent vowel > ++// _va Khmer split vowel in wich the first part is before the base and the second one above the base > ++// _vr Khmer split vowel in wich the first part is before the base and the second one behind (right of) the base > + > + static const KhmerClassTable::CharClass khmerCharClasses[] = > + { > +@@ -129,19 +114,19 @@ > + // > + > + // > +-// The range of characters defined in the above table is defined > +-// here. FOr Khmer 1780 to 17DF Even if the Khmer range is bigger, all > +-// other characters are not combinable, and therefore treated as _xx > ++// The range of characters defined in the above table is defined here. FOr Khmer 1780 to 17DF > ++// Even if the Khmer range is bigger, all other characters are not combinable, and therefore treated > ++// as _xx > + static const KhmerClassTable khmerClassTable = {0x1780, 0x17df, khmerCharClasses}; > + > + > +-// Below we define how a character in the input string is either in > +-// the khmerCharClasses table (in which case we get its type back), a > +-// ZWJ or ZWNJ (two characters that may appear within the syllable, > +-// but are not in the table) we also get their type back, or an > +-// unknown object in which case we get _xx (CC_RESERVED) back > ++// Below we define how a character in the input string is either in the khmerCharClasses table > ++// (in which case we get its type back), a ZWJ or ZWNJ (two characters that may appear > ++// within the syllable, but are not in the table) we also get their type back, or an unknown object > ++// in which case we get _xx (CC_RESERVED) back > + KhmerClassTable::CharClass KhmerClassTable::getCharClass(LEUnicode ch) const > + { > ++ > + if (ch == C_SIGN_ZWJ) { > + return CC_ZERO_WIDTH_J_MARK; > + } > +@@ -164,13 +149,14 @@ > + > + > + > +-class ReorderingOutput { > ++class ReorderingOutput : public UMemory { > + private: > + le_int32 fOutIndex; > + LEUnicode *fOutChars; > + > + LEGlyphStorage &fGlyphStorage; > + > ++ > + public: > + ReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage) > + : fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage) > +@@ -232,18 +218,11 @@ > + #define abvmFeatureMask 0x00100000UL > + #define mkmkFeatureMask 0x00080000UL > + > +-#define tagPref (prefFeatureMask | presFeatureMask | \ > +- cligFeatureMask | distFeatureMask) > +-#define tagAbvf (abvfFeatureMask | abvsFeatureMask | \ > +- cligFeatureMask | distFeatureMask | abvmFeatureMask | mkmkFeatureMask) > +-#define tagPstf (blwfFeatureMask | blwsFeatureMask | prefFeatureMask | \ > +- presFeatureMask | pstfFeatureMask | pstsFeatureMask | cligFeatureMask | \ > +- distFeatureMask | blwmFeatureMask) > +-#define tagBlwf (blwfFeatureMask | blwsFeatureMask | cligFeatureMask | \ > +- distFeatureMask | blwmFeatureMask | mkmkFeatureMask) > +-#define tagDefault (prefFeatureMask | blwfFeatureMask | presFeatureMask | \ > +- blwsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | \ > +- blwmFeatureMask | mkmkFeatureMask) > ++#define tagPref (prefFeatureMask | presFeatureMask | cligFeatureMask | distFeatureMask) > ++#define tagAbvf (abvfFeatureMask | abvsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | mkmkFeatureMask) > ++#define tagPstf (blwfFeatureMask | blwsFeatureMask | prefFeatureMask | presFeatureMask | pstfFeatureMask | pstsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask) > ++#define tagBlwf (blwfFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask | mkmkFeatureMask) > ++#define tagDefault (prefFeatureMask | blwfFeatureMask | presFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | blwmFeatureMask | mkmkFeatureMask) > + > + > + > +@@ -274,35 +253,32 @@ > + // The stateTable is used to calculate the end (the length) of a well > + // formed Khmer Syllable. > + // > +-// Each horizontal line is ordered exactly the same way as the values > +-// in KhmerClassTable CharClassValues in KhmerReordering.h This > +-// coincidence of values allows the follow up of the table. > ++// Each horizontal line is ordered exactly the same way as the values in KhmerClassTable > ++// CharClassValues in KhmerReordering.h This coincidence of values allows the > ++// follow up of the table. > + // > +-// Each line corresponds to a state, which does not necessarily need > +-// to be a type of component... for example, state 2 is a base, with > +-// is always a first character in the syllable, but the state could be > +-// produced a consonant of any type when it is the first character > +-// that is analysed (in ground state). > ++// Each line corresponds to a state, which does not necessarily need to be a type > ++// of component... for example, state 2 is a base, with is always a first character > ++// in the syllable, but the state could be produced a consonant of any type when > ++// it is the first character that is analysed (in ground state). > + // > + // Differentiating 3 types of consonants is necessary in order to > + // forbid the use of certain combinations, such as having a second > +-// coeng after a coeng RO. > +-// The inexistent possibility of having a type 3 after another type 3 > +-// is permitted, eliminating it would very much complicate the table, > +-// and it does not create typing problems, as the case above. > ++// coeng after a coeng RO, > ++// The inexistent possibility of having a type 3 after another type 3 is permitted, > ++// eliminating it would very much complicate the table, and it does not create typing > ++// problems, as the case above. > + // > +-// The table is quite complex, in order to limit the number of coeng > +-// consonants to 2 (by means of the table). > ++// The table is quite complex, in order to limit the number of coeng consonants > ++// to 2 (by means of the table). > + // > + // There a peculiarity, as far as Unicode is concerned: > + // - The consonant-shifter is considered in two possible different > +-// locations, the one considered in Unicode 3.0 and the one considered > +-// in Unicode 4.0. (there is a backwards compatibility problem in this > +-// standard). > ++// locations, the one considered in Unicode 3.0 and the one considered in > ++// Unicode 4.0. (there is a backwards compatibility problem in this standard). > + > + > +-// xx independent character, such as a number, punctuation sign or > +-// non-khmer char > ++// xx independent character, such as a number, punctuation sign or non-khmer char > + // > + // c1 Khmer consonant of type 1 or an independent vowel > + // that is, a letter in which the subscript for is only under the > +@@ -320,10 +296,9 @@ > + // > + // co coeng character (u17D2) > + // > +-// dv dependent vowel (including split vowels, they are treated in the > +-// same way). even if dv is not defined above, the component that is > +-// really tested for is KhmerClassTable::CC_DEPENDENT_VOWEL, which is > +-// common to all dependent vowels > ++// dv dependent vowel (including split vowels, they are treated in the same way). > ++// even if dv is not defined above, the component that is really tested for is > ++// KhmerClassTable::CC_DEPENDENT_VOWEL, which is common to all dependent vowels > + // > + // zwj Zero Width joiner > + // > +@@ -352,8 +327,7 @@ > + {-1, -1, -1, -1, 12, 13, -1, -1, 16, 17, 1, 14}, // 8 - First consonant of type 2 after coeng > + {-1, -1, -1, -1, 12, 13, -1, 10, 16, 17, 1, 14}, // 9 - First consonant or type 3 after ceong > + {-1, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 10 - Second Coeng (no register shifter before) > +- {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 11 - Second coeng consonant > +- // (or ind. vowel) no register shifter before > ++ {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 11 - Second coeng consonant (or ind. vowel) no register shifter before > + {-1, -1, 1, -1, -1, 13, -1, -1, 16, -1, -1, -1}, // 12 - Second ZWNJ before a register shifter > + {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 13 - Second register shifter > + {-1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1}, // 14 - ZWJ before vowel > +@@ -363,6 +337,7 @@ > + {-1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1}, // 18 - ZWJ after vowel > + {-1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 19 - Third coeng > + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1}, // 20 - dependent vowel after a Robat > ++ > + }; > + > + > +@@ -377,15 +352,13 @@ > + // Given an input string of characters and a location in which to start looking > + // calculate, using the state table, which one is the last character of the syllable > + // that starts in the starting position. > +-le_int32 KhmerReordering::findSyllable(const KhmerClassTable *classTable, > +- const LEUnicode *chars, le_int32 prev, le_int32 charCount) > ++le_int32 KhmerReordering::findSyllable(const KhmerClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) > + { > + le_int32 cursor = prev; > + le_int8 state = 0; > + > + while (cursor < charCount) { > +- KhmerClassTable::CharClass charClass = (classTable->getCharClass(chars[cursor]) > +- & KhmerClassTable::CF_CLASS_MASK); > ++ KhmerClassTable::CharClass charClass = (classTable->getCharClass(chars[cursor]) & KhmerClassTable::CF_CLASS_MASK); > + > + state = khmerStateTable[state][charClass]; > + > +@@ -402,8 +375,8 @@ > + > + // This is the real reordering function as applied to the Khmer language > + > +-le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, > +- le_int32 /*scriptCode*/, LEUnicode *outChars, LEGlyphStorage &glyphStorage) > ++le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, le_int32 /*scriptCode*/, > ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage) > + { > + const KhmerClassTable *classTable = KhmerClassTable::getKhmerClassTable(); > + > +@@ -442,8 +415,7 @@ > + // and because CC_CONSONANT2 is enough to identify it, as it is the only consonant > + // with this flag > + if ( (charClass & KhmerClassTable::CF_COENG) && (i + 1 < syllable) && > +- ( (classTable->getCharClass(chars[i + 1]) & > +- KhmerClassTable::CF_CLASS_MASK) == KhmerClassTable::CC_CONSONANT2) ) > ++ ( (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_CLASS_MASK) == KhmerClassTable::CC_CONSONANT2) ) > + { > + coengRo = i; > + } > +@@ -455,16 +427,15 @@ > + output.writeChar(C_RO, coengRo + 1, tagPref); > + } > + > +- // shall we add a dotted circle? If in the position in which > +- // the base should be (first char in the string) there is a > +- // character that has the Dotted circle flag (a character that > +- // cannot be a base) then write a dotted circle > ++ // shall we add a dotted circle? > ++ // If in the position in which the base should be (first char in the string) there is > ++ // a character that has the Dotted circle flag (a character that cannot be a base) > ++ // then write a dotted circle > + if (classTable->getCharClass(chars[prev]) & KhmerClassTable::CF_DOTTED_CIRCLE) { > + output.writeChar(C_DOTTED_CIRCLE, prev, tagDefault); > + } > + > +- // copy what is left to the output, skipping before vowels and > +- // coeng Ro if they are present > ++ // copy what is left to the output, skipping before vowels and coeng Ro if they are present > + for (i = prev; i < syllable; i += 1) { > + charClass = classTable->getCharClass(chars[i]); > + > +@@ -515,30 +486,14 @@ > + // and there is an extra rule for C_VOWEL_AA + C_SIGN_NIKAHIT also for two > + // different positions, right after the shifter or after a vowel (Unicode 4) > + if ( (charClass & KhmerClassTable::CF_SHIFTER) && (i + 1 < syllable) ) { > +- if (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_ABOVE_VOWEL ) { > +- output.writeChar(chars[i], i, tagBlwf); > +- break; > +- } > +- if (i + 2 < syllable && > +- ( (classTable->getCharClass(chars[i + 1]) & > +- KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) && > +- ( (classTable->getCharClass(chars[i + 2]) & > +- KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) > +- { > +- output.writeChar(chars[i], i, tagBlwf); > +- break; > +- } > +- if (i + 3 < syllable && (classTable->getCharClass(chars[i + 3]) & > +- KhmerClassTable::CF_ABOVE_VOWEL) ) > +- { > +- output.writeChar(chars[i], i, tagBlwf); > +- break; > +- } > +- if (i + 4 < syllable && > +- ( (classTable->getCharClass(chars[i + 3]) & > +- KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) && > +- ( (classTable->getCharClass(chars[i + 4]) & > +- KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) > ++ if ((classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_ABOVE_VOWEL) > ++ || (i + 2 < syllable > ++ && ( (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) > ++ && ( (classTable->getCharClass(chars[i + 2]) & KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT)) > ++ || (i + 3 < syllable && (classTable->getCharClass(chars[i + 3]) & KhmerClassTable::CF_ABOVE_VOWEL)) > ++ || (i + 4 < syllable > ++ && ( (classTable->getCharClass(chars[i + 3]) & KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) > ++ && ( (classTable->getCharClass(chars[i + 4]) & KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) ) > + { > + output.writeChar(chars[i], i, tagBlwf); > + break; > +@@ -556,3 +511,6 @@ > + > + return output.getOutputIndex(); > + } > ++ > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerReordering.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerReordering.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerReordering.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + * This file is a modification of the ICU file IndicReordering.h > +@@ -35,80 +34,60 @@ > + #ifndef __KHMERREORDERING_H > + #define __KHMERREORDERING_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + // Vocabulary > +- > +-// Base -> > +-// A consonant or an independent vowel in its full (not > +-// subscript) form. It is the center of the syllable, it can be > +-// souranded by coeng (subscript) consonants, vowels, split > +-// vowels, signs... but there is only one base in a syllable, it > +-// has to be coded as the first character of the syllable. > +-// split vowel -> > +-// vowel that has two parts placed separately (e.g. Before and > +-// after the consonant). Khmer language has five of them. Khmer > +-// split vowels either have one part before the base and one after > +-// the base or they have a part before the base and a part above > +-// the base. The first part of all Khmer split vowels is the same > +-// character, identical to the glyph of Khmer dependent vowel SRA > +-// EI > +-// coeng -> > +-// modifier used in Khmer to construct coeng (subscript) > +-// consonants differently than indian languages, the coeng > +-// modifies the consonant that follows it, not the one preceding > +-// it Each consonant has two forms, the base form and the > +-// subscript form the base form is the normal one (using the > +-// consonants code-point), the subscript form is displayed when > +-// the combination coeng + consonant is encountered. > +-// Consonant of type 1 -> > +-// A consonant which has subscript for that only occupies space > +-// under a base consonant > +-// Consonant of type 2 -> > +-// Its subscript form occupies space under and before the base > +-// (only one, RO) > +-// Consonant of Type 3 -> > +-// Its subscript form occupies space under and after the base > +-// (KHO, CHHO, THHO, BA, YO, SA) > +-// Consonant shifter -> > +-// Khmer has to series of consonants. The same dependent vowel has > +-// different sounds if it is attached to a consonant of the first > +-// series or a consonant of the second series Most consonants have > +-// an equivalent in the other series, but some of theme exist only > +-// in one series (for example SA). If we want to use the consonant > +-// SA with a vowel sound that can only be done with a vowel sound > +-// that corresponds to a vowel accompanying a consonant of the > +-// other series, then we need to use a consonant shifter: TRIISAP > +-// or MUSIKATOAN x17C9 y x17CA. TRIISAP changes a first series > +-// consonant to second series sound and MUSIKATOAN a second series > +-// consonant to have a first series vowel sound. Consonant > +-// shifter are both normally supercript marks, but, when they are > +-// followed by a superscript, they change shape and take the form > +-// of subscript dependent vowel SRA U. If they are in the same > +-// syllable as a coeng consonant, Unicode 3.0 says that they > +-// should be typed before the coeng. Unicode 4.0 breaks the > +-// standard and says that it should be placed after the coeng > +-// consonant. > +-// Dependent vowel -> > +-// In khmer dependent vowels can be placed above, below, before or > +-// after the base Each vowel has its own position. Only one vowel > +-// per syllable is allowed. > +-// Signs -> > +-// Khmer has above signs and post signs. Only one above sign > +-// and/or one post sign are Allowed in a syllable. > ++// Base -> A consonant or an independent vowel in its full (not subscript) form. It is the > ++// center of the syllable, it can be souranded by coeng (subscript) consonants, vowels, > ++// split vowels, signs... but there is only one base in a syllable, it has to be coded as > ++// the first character of the syllable. > ++// split vowel --> vowel that has two parts placed separately (e.g. Before and after the consonant). > ++// Khmer language has five of them. Khmer split vowels either have one part before the > ++// base and one after the base or they have a part before the base and a part above the base. > ++// The first part of all Khmer split vowels is the same character, identical to > ++// the glyph of Khmer dependent vowel SRA EI > ++// coeng --> modifier used in Khmer to construct coeng (subscript) consonants > ++// Differently than indian languages, the coeng modifies the consonant that follows it, > ++// not the one preceding it Each consonant has two forms, the base form and the subscript form > ++// the base form is the normal one (using the consonants code-point), the subscript form is > ++// displayed when the combination coeng + consonant is encountered. > ++// Consonant of type 1 -> A consonant which has subscript for that only occupies space under a base consonant > ++// Consonant of type 2.-> Its subscript form occupies space under and before the base (only one, RO) > ++// Consonant of Type 3 -> Its subscript form occupies space under and after the base (KHO, CHHO, THHO, BA, YO, SA) > ++// Consonant shifter -> Khmer has to series of consonants. The same dependent vowel has different sounds > ++// if it is attached to a consonant of the first series or a consonant of the second series > ++// Most consonants have an equivalent in the other series, but some of theme exist only in > ++// one series (for example SA). If we want to use the consonant SA with a vowel sound that > ++// can only be done with a vowel sound that corresponds to a vowel accompanying a consonant > ++// of the other series, then we need to use a consonant shifter: TRIISAP or MUSIKATOAN > ++// x17C9 y x17CA. TRIISAP changes a first series consonant to second series sound and > ++// MUSIKATOAN a second series consonant to have a first series vowel sound. > ++// Consonant shifter are both normally supercript marks, but, when they are followed by a > ++// superscript, they change shape and take the form of subscript dependent vowel SRA U. > ++// If they are in the same syllable as a coeng consonant, Unicode 3.0 says that they > ++// should be typed before the coeng. Unicode 4.0 breaks the standard and says that it should > ++// be placed after the coeng consonant. > ++// Dependent vowel -> In khmer dependent vowels can be placed above, below, before or after the base > ++// Each vowel has its own position. Only one vowel per syllable is allowed. > ++// Signs -> Khmer has above signs and post signs. Only one above sign and/or one post sign are > ++// Allowed in a syllable. > ++// > + // > + > +-// This list must include all types of components that can be used > +-// inside a syllable > +-struct KhmerClassTable > ++struct KhmerClassTable // This list must include all types of components that can be used inside a syllable > + { > +- // order is important here! This order must be the same that is > +- // found in each horizontal line in the statetable for Khmer (file > +- // KhmerReordering.cpp). > +- enum CharClassValues > ++ enum CharClassValues // order is important here! This order must be the same that is found in each horizontal > ++ // line in the statetable for Khmer (file KhmerReordering.cpp). > + { > + CC_RESERVED = 0, > + CC_CONSONANT = 1, // consonant of type 1 or independent vowel > +@@ -116,8 +95,7 @@ > + CC_CONSONANT3 = 3, // Consonant of type 3 > + CC_ZERO_WIDTH_NJ_MARK = 4, // Zero Width non joiner character (0x200C) > + CC_CONSONANT_SHIFTER = 5, > +- CC_ROBAT = 6, // Khmer special diacritic accent > +- // -treated differently in state table > ++ CC_ROBAT = 6, // Khmer special diacritic accent -treated differently in state table > + CC_COENG = 7, // Subscript consonant combining character > + CC_DEPENDENT_VOWEL = 8, > + CC_SIGN_ABOVE = 9, > +@@ -131,10 +109,8 @@ > + CF_CLASS_MASK = 0x0000FFFF, > + > + CF_CONSONANT = 0x01000000, // flag to speed up comparing > +- CF_SPLIT_VOWEL = 0x02000000, // flag for a split vowel -> the first part > +- // is added in front of the syllable > +- CF_DOTTED_CIRCLE = 0x04000000, // add a dotted circle if a character with > +- // this flag is the first in a syllable > ++ CF_SPLIT_VOWEL = 0x02000000, // flag for a split vowel -> the first part is added in front of the syllable > ++ CF_DOTTED_CIRCLE = 0x04000000, // add a dotted circle if a character with this flag is the first in a syllable > + CF_COENG = 0x08000000, // flag to speed up comparing > + CF_SHIFTER = 0x10000000, // flag to speed up comparing > + CF_ABOVE_VOWEL = 0x20000000, // flag to speed up comparing > +@@ -161,10 +137,10 @@ > + }; > + > + > +-class KhmerReordering { > ++class KhmerReordering /* not : public UObject because all methods are static */ { > + public: > +- static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, > +- le_int32 scriptCode, LEUnicode *outChars, LEGlyphStorage &glyphStorage); > ++ static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, > ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage); > + > + static const FeatureMap *getFeatureMap(le_int32 &count); > + > +@@ -172,8 +148,10 @@ > + // do not instantiate > + KhmerReordering(); > + > +- static le_int32 findSyllable(const KhmerClassTable *classTable, > +- const LEUnicode *chars, le_int32 prev, le_int32 charCount); > ++ static le_int32 findSyllable(const KhmerClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount); > ++ > + }; > + > ++ > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEFontInstance.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + ******************************************************************************* > + * > + * Copyright (C) 1999-2005, International Business Machines > +@@ -42,6 +41,10 @@ > + #include "LEFontInstance.h" > + #include "LEGlyphStorage.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEFontInstance) > ++ > + const LEFontInstance *LEFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, > + le_int32 script, LEErrorCode &success) const > + { > +@@ -59,7 +62,7 @@ > + } > + > + void LEFontInstance::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, > +- le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const > ++ le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const > + { > + le_int32 i, out = 0, dir = 1; > + > +@@ -100,3 +103,5 @@ > + > + return mapCharToGlyph(mappedChar); > + } > ++U_NAMESPACE_END > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEFontInstance.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEFontInstance.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEFontInstance.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,12 @@ > + #define __LEFONTINSTANCE_H > + > + #include "LETypes.h" > ++/** > ++ * \file > ++ * \brief C++ API: Layout Engine Font Instance object > ++ */ > ++ > ++U_NAMESPACE_BEGIN > + > + /** > + * Instances of this class are used by LEFontInstance::mapCharsToGlyphs and > +@@ -44,7 +50,7 @@ > + * > + * @stable ICU 3.2 > + */ > +-class LECharMapper > ++class LECharMapper /* not : public UObject because this is an interface/mixin class */ > + { > + public: > + /** > +@@ -97,7 +103,7 @@ > + * > + * @draft ICU 3.0 > + */ > +-class LEFontInstance > ++class U_LAYOUT_API LEFontInstance : public UObject > + { > + public: > + > +@@ -160,8 +166,7 @@ > + * > + * @stable ICU 3.2 > + */ > +- virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, > +- le_int32 limit, le_int32 script, LEErrorCode &success) const; > ++ virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const; > + > + // > + // Font file access > +@@ -238,8 +243,7 @@ > + * > + * @draft ICU 3.0 > + */ > +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, > +- le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const; > ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const; > + > + /** > + * This method maps a single character to a glyph index, using the > +@@ -502,6 +506,21 @@ > + * @stable ICU 3.2 > + */ > + virtual le_int32 getLineHeight() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 3.2 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 3.2 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + }; > + > + inline le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const > +@@ -562,4 +581,7 @@ > + return getAscent() + getDescent() + getLeading(); > + } > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphFilter.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphFilter.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphFilter.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,14 +34,15 @@ > + > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /** > + * This is a helper class that is used to > + * recognize a set of glyph indices. > + * > + * @internal > + */ > +-class LEGlyphFilter > +-{ > ++class LEGlyphFilter /* not : public UObject because this is an interface/mixin class */ { > + public: > + /** > + * Destructor. > +@@ -63,4 +64,5 @@ > + virtual le_bool accept(LEGlyphID glyph) const = 0; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphStorage.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + ********************************************************************** > + * Copyright (C) 1998-2005, International Business Machines > + * Corporation and others. All Rights Reserved. > +@@ -35,6 +34,10 @@ > + #include "LEInsertionList.h" > + #include "LEGlyphStorage.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEGlyphStorage) > ++ > + LEGlyphStorage::LEGlyphStorage() > + : fGlyphCount(0), fGlyphs(NULL), fCharIndices(NULL), fPositions(NULL), > + fAuxData(NULL), fInsertionList(NULL), fSrcIndex(0), fDestIndex(0) > +@@ -603,3 +606,6 @@ > + > + return FALSE; > + } > ++ > ++U_NAMESPACE_END > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphStorage.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + ********************************************************************** > + * Copyright (C) 1998-2005, International Business Machines > + * Corporation and others. All Rights Reserved. > +@@ -38,6 +37,13 @@ > + #include "LEInsertionList.h" > + > + /** > ++ * \file > ++ * \brief C++ API: This class encapsulates the per-glyph storage used by the ICU LayoutEngine. > ++ */ > ++ > ++U_NAMESPACE_BEGIN > ++ > ++/** > + * This class encapsulates the per-glyph storage used by the ICU LayoutEngine. > + * For each glyph it holds the glyph ID, the index of the backing store character > + * which produced the glyph, the X and Y position of the glyph and an auxillary data > +@@ -50,7 +56,7 @@ > + * > + * @draft ICU 3.6 > + */ > +-class U_LAYOUT_API LEGlyphStorage : protected LEInsertionCallback > ++class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback > + { > + private: > + /** > +@@ -112,35 +118,37 @@ > + > + protected: > + /** > +- * This implements LEInsertionCallback. The > +- * LEInsertionList will call this method once for > +- * each insertion. > ++ * This implements LEInsertionCallback. The LEInsertionList > ++ * will call this method once for each insertion. > + * > + * @param atPosition the position of the insertion > + * @param count the number of glyphs being inserted > + * @param newGlyphs the address of the new glyph IDs > + * > +- * @return true if LEInsertionList > +- * should stop processing the insertion list after this insertion. > ++ * @return true if LEInsertionList should stop > ++ * processing the insertion list after this insertion. > + * > + * @see LEInsertionList.h > + * > + * @draft ICU 3.0 > + */ > +- virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, > +- LEGlyphID newGlyphs[]); > ++ virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]); > + > + public: > + > + /** > +- * Allocates an empty LEGlyphStorage object. You must > +- * call allocateGlyphArray, allocatePositions and > +- * allocateAuxData to allocate the data. > ++ * Allocates an empty LEGlyphStorage object. You must call > ++ * allocateGlyphArray, allocatePositions and allocateAuxData > ++ * to allocate the data. > ++ * > ++ * @draft ICU 3.0 > + */ > + LEGlyphStorage(); > + > + /** > + * The destructor. This will deallocate all of the arrays. > ++ * > ++ * @draft ICU 3.0 > + */ > + ~LEGlyphStorage(); > + > +@@ -154,9 +162,9 @@ > + inline le_int32 getGlyphCount() const; > + > + /** > +- * This method copies the glyph array into a caller supplied > +- * array. The caller must ensure that the array is large enough > +- * to hold all the glyphs. > ++ * This method copies the glyph array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold all > ++ * the glyphs. > + * > + * @param glyphs - the destiniation glyph array > + * @param success - set to an error code if the operation fails > +@@ -166,10 +174,10 @@ > + void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; > + > + /** > +- * This method copies the glyph array into a caller supplied > +- * array, ORing in extra bits. (This functionality is needed by > +- * the JDK, which uses 32 bits pre glyph idex, with the high 16 > +- * bits encoding the composite font slot number) > ++ * This method copies the glyph array into a caller supplied array, > ++ * ORing in extra bits. (This functionality is needed by the JDK, > ++ * which uses 32 bits pre glyph idex, with the high 16 bits encoding > ++ * the composite font slot number) > + * > + * @param glyphs - the destination (32 bit) glyph array > + * @param extraBits - this value will be ORed with each glyph index > +@@ -177,13 +185,12 @@ > + * > + * @draft ICU 3.0 > + */ > +- void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, > +- LEErrorCode &success) const; > ++ void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; > + > + /** > +- * This method copies the character index array into a caller > +- * supplied array. The caller must ensure that the array is large > +- * enough to hold a character index for each glyph. > ++ * This method copies the character index array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold a > ++ * character index for each glyph. > + * > + * @param charIndices - the destiniation character index array > + * @param success - set to an error code if the operation fails > +@@ -193,9 +200,9 @@ > + void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; > + > + /** > +- * This method copies the character index array into a caller > +- * supplied array. The caller must ensure that the array is large > +- * enough to hold a character index for each glyph. > ++ * This method copies the character index array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold a > ++ * character index for each glyph. > + * > + * @param charIndices - the destiniation character index array > + * @param indexBase - an offset which will be added to each index > +@@ -203,14 +210,13 @@ > + * > + * @draft ICU 3.0 > + */ > +- void getCharIndices(le_int32 charIndices[], le_int32 indexBase, > +- LEErrorCode &success) const; > ++ void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; > + > + /** > +- * This method copies the position array into a caller supplied > +- * array. The caller must ensure that the array is large enough > +- * to hold an X and Y position for each glyph, plus an extra X and > +- * Y for the advance of the last glyph. > ++ * This method copies the position array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold an > ++ * X and Y position for each glyph, plus an extra X and Y for the > ++ * advance of the last glyph. > + * > + * @param positions - the destiniation position array > + * @param success - set to an error code if the operation fails > +@@ -233,33 +239,27 @@ > + * > + * @draft ICU 3.0 > + */ > +- void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, > +- LEErrorCode &success) const; > ++ void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; > + > + /** > +- * This method allocates the glyph array, the char indices array > +- * and the insertion list. You must call this method before using > +- * the object. This method also initializes the char indices > ++ * This method allocates the glyph array, the char indices array and the insertion list. You > ++ * must call this method before using the object. This method also initializes the char indices > + * array. > +- * @param initialGlyphCount the initial size of the glyph and char > +- * indices arrays. > +- * @param rightToLeft true if the original input text > +- * is right to left. > +- * @param success set to an error code if the storage cannot be > +- * allocated of if the initial glyph count is not positive. > ++ * > ++ * @param initialGlyphCount the initial size of the glyph and char indices arrays. > ++ * @param rightToLeft true if the original input text is right to left. > ++ * @param success set to an error code if the storage cannot be allocated of if the initial > ++ * glyph count is not positive. > + * > + * @draft ICU 3.0 > + */ > +- void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, > +- LEErrorCode &success); > ++ void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success); > + > + /** > +- * This method allocates the storage for the glyph positions. It > +- * allocates one extra X, Y position pair for the position just > +- * after the last glyph. > ++ * This method allocates the storage for the glyph positions. It allocates one extra X, Y > ++ * position pair for the position just after the last glyph. > + * > +- * @param success set to an error code if the positions array > +- * cannot be allocated. > ++ * @param success set to an error code if the positions array cannot be allocated. > + * > + * @return the number of X, Y position pairs allocated. > + * > +@@ -270,8 +270,7 @@ > + /** > + * This method allocates the storage for the auxillary glyph data. > + * > +- * @param success set to an error code if the aulillary data array > +- * cannot be allocated. > ++ * @param success set to an error code if the aulillary data array cannot be allocated. > + * > + * @return the size of the auxillary data array. > + * > +@@ -282,10 +281,8 @@ > + /** > + * Copy the entire auxillary data array. > + * > +- * @param auxData the auxillary data array will be copied to this > +- * address > +- * @param success set to an error code if the data cannot be > +- * copied > ++ * @param auxData the auxillary data array will be copied to this address > ++ * @param success set to an error code if the data cannot be copied > + * > + * @draft ICU 3.6 > + */ > +@@ -295,8 +292,7 @@ > + * Get the glyph ID for a particular glyph. > + * > + * @param glyphIndex the index into the glyph array > +- * @param success set to an error code if the glyph ID cannot be > +- * retrieved. > ++ * @param success set to an error code if the glyph ID cannot be retrieved. > + * > + * @return the glyph ID > + * > +@@ -308,8 +304,7 @@ > + * Get the char index for a particular glyph. > + * > + * @param glyphIndex the index into the glyph array > +- * @param success set to an error code if the char index cannot be > +- * retrieved. > ++ * @param success set to an error code if the char index cannot be retrieved. > + * > + * @return the character index > + * > +@@ -322,8 +317,7 @@ > + * Get the auxillary data for a particular glyph. > + * > + * @param glyphIndex the index into the glyph array > +- * @param success set to an error code if the auxillary data > +- * cannot be retrieved. > ++ * @param success set to an error code if the auxillary data cannot be retrieved. > + * > + * @return the auxillary data > + * > +@@ -345,11 +339,10 @@ > + > + /** > + * Call this method to replace a single glyph in the glyph array > +- * with multiple glyphs. This method uses the > +- * LEInsertionList to do the insertion. It returns > +- * the address of storage where the new glyph IDs can be > +- * stored. They will not actually be inserted into the glyph array > +- * until applyInsertions is called. > ++ * with multiple glyphs. This method uses the LEInsertionList > ++ * to do the insertion. It returns the address of storage where the new > ++ * glyph IDs can be stored. They will not actually be inserted into the > ++ * glyph array until applyInsertions is called. > + * > + * @param atIndex the index of the glyph to be replaced > + * @param insertCount the number of glyphs to replace it with > +@@ -381,26 +374,22 @@ > + * > + * @param glyphIndex the index of the glyph > + * @param glyphID the new glyph ID > +- * @param success will be set to an error code if the glyph ID > +- * cannot be set. > ++ * @param success will be set to an error code if the glyph ID cannot be set. > + * > + * @draft ICU 3.0 > + */ > +- void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, > +- LEErrorCode &success); > ++ void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success); > + > + /** > + * Set the char index for a particular glyph. > + * > + * @param glyphIndex the index of the glyph > + * @param charIndex the new char index > +- * @param success will be set to an error code if the char index > +- * cannot be set. > ++ * @param success will be set to an error code if the char index cannot be set. > + * > + * @draft ICU 3.0 > + */ > +- void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, > +- LEErrorCode &success); > ++ void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success); > + > + /** > + * Set the X, Y position for a particular glyph. > +@@ -408,13 +397,11 @@ > + * @param glyphIndex the index of the glyph > + * @param x the new X position > + * @param y the new Y position > +- * @param success will be set to an error code if the position > +- * cannot be set. > ++ * @param success will be set to an error code if the position cannot be set. > + * > + * @draft ICU 3.0 > + */ > +- void setPosition(le_int32 glyphIndex, float x, float y, > +- LEErrorCode &success); > ++ void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success); > + > + /** > + * Adjust the X, Y position for a particular glyph. > +@@ -422,21 +409,18 @@ > + * @param glyphIndex the index of the glyph > + * @param xAdjust the adjustment to the glyph's X position > + * @param yAdjust the adjustment to the glyph's Y position > +- * @param success will be set to an error code if the glyph's > +- * position cannot be adjusted. > ++ * @param success will be set to an error code if the glyph's position cannot be adjusted. > + * > + * @draft ICU 3.0 > + */ > +- void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, > +- LEErrorCode &success); > ++ void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success); > + > + /** > + * Set the auxillary data for a particular glyph. > + * > + * @param glyphIndex the index of the glyph > + * @param auxData the new auxillary data > +- * @param success will be set to an error code if the auxillary > +- * data cannot be set. > ++ * @param success will be set to an error code if the auxillary data cannot be set. > + * > + * @draft ICU 3.6 > + */ > +@@ -511,14 +495,28 @@ > + void adoptGlyphCount(le_int32 newGlyphCount); > + > + /** > +- * This method frees the glyph, character index, position and > +- * auxillary data arrays so that the LayoutEngine can be reused to > +- * layout a different characer array. (This method is also called > ++ * This method frees the glyph, character index, position and > ++ * auxillary data arrays so that the LayoutEngine can be reused > ++ * to layout a different characer array. (This method is also called > + * by the destructor) > + * > + * @draft ICU 3.0 > + */ > + void reset(); > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @draft ICU 3.0 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @draft ICU 3.0 > ++ */ > ++ static UClassID getStaticClassID(); > + }; > + > + inline le_int32 LEGlyphStorage::getGlyphCount() const > +@@ -531,4 +529,7 @@ > + return fGlyphs[glyphIndex]; > + } > + > ++ > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEInsertionList.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + ********************************************************************** > + * Copyright (C) 1998-2004, International Business Machines > + * Corporation and others. All Rights Reserved. > +@@ -34,6 +33,8 @@ > + #include "LETypes.h" > + #include "LEInsertionList.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define ANY_NUMBER 1 > + > + struct InsertionRecord > +@@ -44,6 +45,8 @@ > + LEGlyphID glyphs[ANY_NUMBER]; > + }; > + > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEInsertionList) > ++ > + LEInsertionList::LEInsertionList(le_bool rightToLeft) > + : head(NULL), tail(NULL), growAmount(0), append(rightToLeft) > + { > +@@ -106,3 +109,5 @@ > + > + return FALSE; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEInsertionList.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEInsertionList.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEInsertionList.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -24,7 +24,6 @@ > + */ > + > + /* > +- * > + ********************************************************************** > + * Copyright (C) 1998-2004, International Business Machines > + * Corporation and others. All Rights Reserved. > +@@ -36,6 +35,8 @@ > + > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct InsertionRecord; > + > + /** > +@@ -78,7 +79,7 @@ > + * > + * @internal > + */ > +-class LEInsertionList > ++class LEInsertionList : public UObject > + { > + public: > + /** > +@@ -140,6 +141,20 @@ > + */ > + void reset(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + > + /** > +@@ -174,4 +189,6 @@ > + le_bool append; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LELanguages.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LELanguages.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LELanguages.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,10 +25,12 @@ > + > + /* > + * > +- * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. > ++ * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. > + * > + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS > + * YOU REALLY KNOW WHAT YOU'RE DOING. > ++ * > ++ * Generated on: 07/19/2005 01:01:08 PM PDT > + */ > + > + #ifndef __LELANGUAGES_H > +@@ -37,11 +39,18 @@ > + #include "LETypes.h" > + > + /** > ++ * \file > ++ * \brief C++ API: List of language codes for LayoutEngine > ++ */ > ++ > ++U_NAMESPACE_BEGIN > ++ > ++/** > + * A provisional list of language codes. For now, > + * this is just a list of languages which the LayoutEngine > + * supports. > + * > +- * @draft ICU 3.0 > ++ * @draft ICU 3.4 > + */ > + > + enum LanguageCodes { > +@@ -79,4 +88,5 @@ > + languageCodeCount = 30 > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEScripts.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEScripts.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEScripts.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,17 +25,23 @@ > + > + /* > + * > +- * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. > ++ * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. > + * > + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS > + * YOU REALLY KNOW WHAT YOU'RE DOING. > +- * > + */ > + > + #ifndef __LESCRIPTS_H > + #define __LESCRIPTS_H > + > + #include "LETypes.h" > ++/** > ++ * \file > ++ * \brief C++ API: Constants for Unicode script values > ++ */ > ++ > ++ > ++U_NAMESPACE_BEGIN > + > + /** > + * Constants for Unicode script values, generated using > +@@ -104,4 +110,5 @@ > + scriptCodeCount = 55 > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEStandalone.h > +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LEStandalone.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -0,0 +1,132 @@ > ++/* > ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > ++ * > ++ * This code is free software; you can redistribute it and/or modify it > ++ * under the terms of the GNU General Public License version 2 only, as > ++ * published by the Free Software Foundation. Sun designates this > ++ * particular file as subject to the "Classpath" exception as provided > ++ * by Sun in the LICENSE file that accompanied this code. > ++ * > ++ * This code 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 > ++ * version 2 for more details (a copy is included in the LICENSE file that > ++ * accompanied this code). > ++ * > ++ * You should have received a copy of the GNU General Public License version > ++ * 2 along with this work; if not, write to the Free Software Foundation, > ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > ++ * > ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, > ++ * CA 95054 USA or visit www.sun.com if you need additional information or > ++ * have any questions. > ++ * > ++ */ > ++ > ++#ifndef __LESTANDALONE > ++#define __LESTANDALONE > ++ > ++/* Definitions to make Layout Engine work away from ICU. */ > ++#ifndef U_NAMESPACE_BEGIN > ++#define U_NAMESPACE_BEGIN > ++#endif > ++ > ++#ifndef U_NAMESPACE_END > ++#define U_NAMESPACE_END > ++#endif > ++ > ++/* RTTI Definition */ > ++typedef const char *UClassID; > ++#ifndef UOBJECT_DEFINE_RTTI_IMPLEMENTATION > ++#define UOBJECT_DEFINE_RTTI_IMPLEMENTATION(x) UClassID x::getStaticClassID(){static char z=0; return (UClassID)&z; } UClassID x::getDynamicClassID() const{return x::getStaticClassID(); } > ++#endif > ++ > ++/* UMemory's functions aren't used by the layout engine. */ > ++struct UMemory {}; > ++/* UObject's functions aren't used by the layout engine. */ > ++struct UObject {}; > ++ > ++/* String handling */ > ++#include > ++#include > ++ > ++/** > ++ * A convenience macro to test for the success of a LayoutEngine call. > ++ * > ++ * @stable ICU 2.4 > ++ */ > ++#define LE_SUCCESS(code) ((code)<=LE_NO_ERROR) > ++ > ++/** > ++ * A convenience macro to test for the failure of a LayoutEngine call. > ++ * > ++ * @stable ICU 2.4 > ++ */ > ++#define LE_FAILURE(code) ((code)>LE_NO_ERROR) > ++ > ++ > ++#ifndef _LP64 > ++typedef long le_int32; > ++typedef unsigned long le_uint32; > ++#else > ++typedef int le_int32; > ++typedef unsigned int le_uint32; > ++#endif > ++ > ++#define HAVE_LE_INT32 1 > ++#define HAVE_LE_UINT32 1 > ++ > ++typedef unsigned short UChar; > ++typedef le_uint32 UChar32; > ++ > ++typedef short le_int16; > ++#define HAVE_LE_INT16 1 > ++ > ++typedef unsigned short le_uint16; > ++#define HAVE_LE_UINT16 > ++ > ++typedef signed char le_int8; > ++#define HAVE_LE_INT8 > ++ > ++typedef unsigned char le_uint8; > ++#define HAVE_LE_UINT8 > ++ > ++typedef char UBool; > ++ > ++/** > ++ * Error codes returned by the LayoutEngine. > ++ * > ++ * @stable ICU 2.4 > ++ */ > ++enum LEErrorCode { > ++ /* informational */ > ++ LE_NO_SUBFONT_WARNING = -127, // U_USING_DEFAULT_WARNING, > ++ > ++ /* success */ > ++ LE_NO_ERROR = 0, // U_ZERO_ERROR, > ++ > ++ /* failures */ > ++ LE_ILLEGAL_ARGUMENT_ERROR = 1, // U_ILLEGAL_ARGUMENT_ERROR, > ++ LE_MEMORY_ALLOCATION_ERROR = 7, // U_MEMORY_ALLOCATION_ERROR, > ++ LE_INDEX_OUT_OF_BOUNDS_ERROR = 8, //U_INDEX_OUTOFBOUNDS_ERROR, > ++ LE_NO_LAYOUT_ERROR = 16, // U_UNSUPPORTED_ERROR, > ++ LE_INTERNAL_ERROR = 5, // U_INTERNAL_PROGRAM_ERROR, > ++ LE_FONT_FILE_NOT_FOUND_ERROR = 4, // U_FILE_ACCESS_ERROR, > ++ LE_MISSING_FONT_TABLE_ERROR = 2 // U_MISSING_RESOURCE_ERROR > ++}; > ++#define HAVE_LEERRORCODE > ++ > ++#define U_LAYOUT_API > ++ > ++#define uprv_malloc malloc > ++#define uprv_free free > ++#define uprv_memcpy memcpy > ++#define uprv_realloc realloc > ++ > ++#if !defined(U_IS_BIG_ENDIAN) > ++ #ifdef _LITTLE_ENDIAN > ++ #define U_IS_BIG_ENDIAN 0 > ++ #endif > ++#endif > ++ > ++#endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LESwaps.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LESwaps.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LESwaps.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -26,7 +26,7 @@ > + > + /* > + * > +- * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved > ++ * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > + > +@@ -35,11 +35,12 @@ > + > + #include "LETypes.h" > + > +-#if !defined(U_IS_BIG_ENDIAN) > +- #ifdef _LITTLE_ENDIAN > +- #define U_IS_BIG_ENDIAN 0 > +- #endif > +-#endif > ++/** > ++ * \file > ++ * \brief C++ API: Endian independent access to data for LayoutEngine > ++ */ > ++ > ++U_NAMESPACE_BEGIN > + > + /** > + * A convenience macro which invokes the swapWord member function > +@@ -47,7 +48,6 @@ > + * > + * @stable ICU 2.8 > + */ > +- > + #if defined(U_IS_BIG_ENDIAN) > + #if U_IS_BIG_ENDIAN > + #define SWAPW(value) (value) > +@@ -64,7 +64,6 @@ > + * > + * @stable ICU 2.8 > + */ > +- > + #if defined(U_IS_BIG_ENDIAN) > + #if U_IS_BIG_ENDIAN > + #define SWAPL(value) (value) > +@@ -86,8 +85,7 @@ > + * > + * @stable ICU 2.8 > + */ > +-class LESwaps > +-{ > ++class U_LAYOUT_API LESwaps /* not : public UObject because all methods are static */ { > + public: > + > + #if !defined(U_IS_BIG_ENDIAN) > +@@ -144,4 +142,5 @@ > + LESwaps() {} // private - forbid instantiation > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LETypes.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LETypes.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LETypes.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,7 +23,6 @@ > + * > + */ > + > +- > + /* > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > +@@ -33,74 +32,98 @@ > + #ifndef __LETYPES_H > + #define __LETYPES_H > + > +-#define LE_USE_CMEMORY > +- > +-#ifdef LE_USE_CMEMORY > +-#include > +-#include > ++/** > ++ * If LE_Standalone is defined, it must exist and contain > ++ * definitions for some core ICU defines. > ++ */ > ++#ifdef LE_STANDALONE > ++#include "LEStandalone.h" > + #endif > + > +-#ifndef _LP64 > +-typedef long le_int32; > +-typedef unsigned long le_uint32; > ++#ifdef LE_STANDALONE > ++/* Stand-alone Layout Engine- without ICU. */ > ++#include "LEStandalone.h" > ++#define LE_USE_CMEMORY > + #else > +-typedef int le_int32; > +-typedef unsigned int le_uint32; > ++#if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined(U_COMBINED_IMPLEMENTATION)) > ++#define LE_USE_CMEMORY > + #endif > + > +-typedef short le_int16; > +-typedef unsigned short le_uint16; > +-typedef signed char le_int8; > +-typedef unsigned char le_uint8; > +-typedef char le_bool; > ++#include "unicode/utypes.h" > ++#include "unicode/uobject.h" > ++#ifdef LE_USE_CMEMORY > ++#include "cmemory.h" > ++#endif > ++#endif /* not standalone */ > + > +-typedef char UClassID; > + > +-#if 0 > ++U_NAMESPACE_BEGIN > ++ > ++/*! > ++ * \file > ++ * \brief Basic definitions for the ICU LayoutEngine > ++ */ > ++ > + /** > + * A type used for signed, 32-bit integers. > + * > + * @stable ICU 2.4 > + */ > ++#ifndef HAVE_LE_INT32 > + typedef int32_t le_int32; > ++#endif > + > + /** > + * A type used for unsigned, 32-bit integers. > + * > + * @stable ICU 2.4 > + */ > ++#ifndef HAVE_LE_UINT32 > + typedef uint32_t le_uint32; > ++#endif > + > + /** > + * A type used for signed, 16-bit integers. > + * > + * @stable ICU 2.4 > + */ > ++#ifndef HAVE_LE_INT16 > + typedef int16_t le_int16; > ++#endif > + > ++#ifndef HAVE_LE_UINT16 > + /** > + * A type used for unsigned, 16-bit integers. > + * > + * @stable ICU 2.4 > + */ > + typedef uint16_t le_uint16; > ++#endif > + > ++#ifndef HAVE_LE_INT8 > + /** > + * A type used for signed, 8-bit integers. > + * > + * @stable ICU 2.4 > + */ > + typedef int8_t le_int8; > ++#endif > + > ++#ifndef HAVE_LE_UINT8 > + /** > + * A type used for unsigned, 8-bit integers. > + * > + * @stable ICU 2.4 > + */ > + typedef uint8_t le_uint8; > ++#endif > + > +-typedef char le_bool; > +-#endif > ++/** > ++* A type used for boolean values. > ++* > ++* @stable ICU 2.4 > ++*/ > ++typedef UBool le_bool; > + > + #ifndef TRUE > + /** > +@@ -264,21 +287,21 @@ > + * > + * @stable ICU 2.4 > + */ > +-typedef le_uint16 LEUnicode16; > ++typedef UChar LEUnicode16; > + > + /** > + * Used to represent 32-bit Unicode code points. > + * > + * @stable ICU 2.4 > + */ > +-typedef le_uint32 LEUnicode32; > ++typedef UChar32 LEUnicode32; > + > + /** > + * Used to represent 16-bit Unicode code points. > + * > + * @deprecated since ICU 2.4. Use LEUnicode16 instead > + */ > +-typedef le_uint16 LEUnicode; > ++typedef UChar LEUnicode; > + > + /** > + * Used to hold a pair of (x, y) values which represent a point. > +@@ -325,7 +348,7 @@ > + * > + * @internal > + */ > +-#define LE_ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0]) > ++#define LE_ARRAY_COPY(dst, src, count) uprv_memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0]) > + > + /** > + * Allocate an array of basic types. This is used to isolate the rest of > +@@ -333,7 +356,7 @@ > + * > + * @internal > + */ > +-#define LE_NEW_ARRAY(type, count) (type *) malloc((count) * sizeof(type)) > ++#define LE_NEW_ARRAY(type, count) (type *) uprv_malloc((count) * sizeof(type)) > + > + /** > + * Re-allocate an array of basic types. This is used to isolate the rest of > +@@ -341,7 +364,7 @@ > + * > + * @internal > + */ > +-#define LE_GROW_ARRAY(array, newSize) realloc((void *) (array), (newSize) * sizeof (array)[0]) > ++#define LE_GROW_ARRAY(array, newSize) uprv_realloc((void *) (array), (newSize) * sizeof (array)[0]) > + > + /** > + * Free an array of basic types. This is used to isolate the rest of > +@@ -349,7 +372,7 @@ > + * > + * @internal > + */ > +-#define LE_DELETE_ARRAY(array) free((void *) (array)) > ++#define LE_DELETE_ARRAY(array) uprv_free((void *) (array)) > + #endif > + > + /** > +@@ -567,22 +590,24 @@ > + * > + * @stable ICU 2.4 > + */ > ++#ifndef HAVE_LEERRORCODE > + enum LEErrorCode { > + /* informational */ > +- LE_NO_SUBFONT_WARNING = -127, // U_USING_DEFAULT_WARNING, > ++ LE_NO_SUBFONT_WARNING = U_USING_DEFAULT_WARNING, /**< The font does not contain subfonts. */ > + > + /* success */ > +- LE_NO_ERROR = 0, // U_ZERO_ERROR, > ++ LE_NO_ERROR = U_ZERO_ERROR, /**< No error, no warning. */ > + > + /* failures */ > +- LE_ILLEGAL_ARGUMENT_ERROR = 1, // U_ILLEGAL_ARGUMENT_ERROR, > +- LE_MEMORY_ALLOCATION_ERROR = 7, // U_MEMORY_ALLOCATION_ERROR, > +- LE_INDEX_OUT_OF_BOUNDS_ERROR = 8, //U_INDEX_OUTOFBOUNDS_ERROR, > +- LE_NO_LAYOUT_ERROR = 16, // U_UNSUPPORTED_ERROR, > +- LE_INTERNAL_ERROR = 5, // U_INTERNAL_PROGRAM_ERROR, > +- LE_FONT_FILE_NOT_FOUND_ERROR = 4, // U_FILE_ACCESS_ERROR, > +- LE_MISSING_FONT_TABLE_ERROR = 2 // U_MISSING_RESOURCE_ERROR > ++ LE_ILLEGAL_ARGUMENT_ERROR = U_ILLEGAL_ARGUMENT_ERROR, /**< An illegal argument was detected. */ > ++ LE_MEMORY_ALLOCATION_ERROR = U_MEMORY_ALLOCATION_ERROR, /**< Memory allocation error. */ > ++ LE_INDEX_OUT_OF_BOUNDS_ERROR = U_INDEX_OUTOFBOUNDS_ERROR, /**< Trying to access an index that is out of bounds. */ > ++ LE_NO_LAYOUT_ERROR = U_UNSUPPORTED_ERROR, /**< You must call layoutChars() first. */ > ++ LE_INTERNAL_ERROR = U_INTERNAL_PROGRAM_ERROR, /**< An internal error was encountered. */ > ++ LE_FONT_FILE_NOT_FOUND_ERROR = U_FILE_ACCESS_ERROR, /**< The requested font file cannot be opened. */ > ++ LE_MISSING_FONT_TABLE_ERROR = U_MISSING_RESOURCE_ERROR /**< The requested font table does not exist. */ > + }; > ++#endif > + > + #ifndef XP_CPLUSPLUS > + /** > +@@ -598,14 +623,20 @@ > + * > + * @stable ICU 2.4 > + */ > +-#define LE_SUCCESS(code) ((code)<=LE_NO_ERROR) > ++#ifndef LE_FAILURE > ++#define LE_SUCCESS(code) (U_SUCCESS((UErrorCode)code)) > ++#endif > + > + /** > + * A convenience macro to test for the failure of a LayoutEngine call. > + * > + * @stable ICU 2.4 > + */ > +-#define LE_FAILURE(code) ((code)>LE_NO_ERROR) > ++#ifndef LE_FAILURE > ++#define LE_FAILURE(code) (U_FAILURE((UErrorCode)code)) > ++#endif > + > +-#define U_LAYOUT_API > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,6 +23,7 @@ > + * > + */ > + > ++ > + /* > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > +@@ -40,6 +41,7 @@ > + #include "IndicLayoutEngine.h" > + #include "KhmerLayoutEngine.h" > + #include "ThaiLayoutEngine.h" > ++//#include "TibetanLayoutEngine.h" > + #include "GXLayoutEngine.h" > + #include "ScriptAndLanguageTags.h" > + #include "CharSubstitutionFilter.h" > +@@ -55,6 +57,8 @@ > + > + #include "KernTable.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const LEUnicode32 DefaultCharMapper::controlChars[] = { > + 0x0009, 0x000A, 0x000D, > + /*0x200C, 0x200D,*/ 0x200E, 0x200F, > +@@ -101,9 +105,7 @@ > + } > + > + if (fMirror) { > +- le_int32 index = OpenTypeUtilities::search((le_uint32) ch, > +- (le_uint32 *)DefaultCharMapper::mirroredChars, > +- DefaultCharMapper::mirroredCharsCount); > ++ le_int32 index = OpenTypeUtilities::search((le_uint32) ch, (le_uint32 *)DefaultCharMapper::mirroredChars, DefaultCharMapper::mirroredCharsCount); > + > + if (mirroredChars[index] == ch) { > + return DefaultCharMapper::srahCderorrim[index]; > +@@ -132,6 +134,9 @@ > + // nothing to do > + } > + > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LayoutEngine) > ++ > + #define ccmpFeatureTag LE_CCMP_FEATURE_TAG > + > + #define ccmpFeatureMask 0x80000000UL > +@@ -145,10 +150,9 @@ > + > + static const le_int32 canonFeatureMapCount = LE_ARRAY_SIZE(canonFeatureMap); > + > +-LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, le_int32 typoFlags) > +- : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), > +- fLanguageCode(languageCode), fTypoFlags(typoFlags) > ++LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++ : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), fLanguageCode(languageCode), > ++ fTypoFlags(typoFlags) > + { > + fGlyphStorage = new LEGlyphStorage(); > + } > +@@ -158,8 +162,7 @@ > + return fGlyphStorage->getGlyphCount(); > + } > + > +-void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, > +- LEErrorCode &success) const > ++void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const > + { > + fGlyphStorage->getCharIndices(charIndices, indexBase, success); > + } > +@@ -170,8 +173,7 @@ > + } > + > + // Copy the glyphs into caller's (32-bit) glyph array, OR in extraBits > +-void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, > +- LEErrorCode &success) const > ++void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const > + { > + fGlyphStorage->getGlyphs(glyphs, extraBits, success); > + } > +@@ -218,15 +220,13 @@ > + fGlyphStorage->getGlyphPositions(positions, success); > + } > + > +-void LayoutEngine::getGlyphPosition(le_int32 glyphIndex, float &x, float &y, > +- LEErrorCode &success) const > ++void LayoutEngine::getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const > + { > + fGlyphStorage->getGlyphPosition(glyphIndex, x, y, success); > + } > + > +-le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, LEUnicode *&outChars, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -237,12 +237,7 @@ > + return 0; > + } > + > +- if ((fTypoFlags & 0x4) == 0) { // no canonical processing > +- return count; > +- } > +- > +- const GlyphSubstitutionTableHeader *canonGSUBTable = > +- (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; > ++ const GlyphSubstitutionTableHeader *canonGSUBTable = (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; > + LETag scriptTag = OpenTypeLayoutEngine::getScriptTag(fScriptCode); > + LETag langSysTag = OpenTypeLayoutEngine::getLangSysTag(fLanguageCode); > + le_int32 i, dir = 1, out = 0, outCharCount = count; > +@@ -256,16 +251,15 @@ > + // We could just do the mark reordering for all scripts, but most > + // of them probably don't need it... > + if (fScriptCode == hebrScriptCode) { > +- reordered = LE_NEW_ARRAY(LEUnicode, count); > ++ reordered = LE_NEW_ARRAY(LEUnicode, count); > + > +- if (reordered == NULL) { > +- success = LE_MEMORY_ALLOCATION_ERROR; > +- return 0; > +- } > ++ if (reordered == NULL) { > ++ success = LE_MEMORY_ALLOCATION_ERROR; > ++ return 0; > ++ } > + > +- CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, > +- reordered, glyphStorage); > +- inChars = reordered; > ++ CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, glyphStorage); > ++ inChars = reordered; > + } > + > + glyphStorage.allocateGlyphArray(count, rightToLeft, success); > +@@ -289,8 +283,7 @@ > + LE_DELETE_ARRAY(reordered); > + } > + > +- outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, > +- langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE); > ++ outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE); > + > + out = (rightToLeft? count - 1 : 0); > + > +@@ -305,35 +298,26 @@ > + return outCharCount; > + } > + > +- > +-le_int32 LayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 LayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || > +- offset + count > max) { > +- > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > + > + LEUnicode *outChars = NULL; > +- le_int32 outCharCount = characterProcessing(chars, offset, count, max, > +- rightToLeft, outChars, glyphStorage, success); > ++ le_int32 outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success); > + > + if (outChars != NULL) { > +- mapCharsToGlyphs(outChars, 0, outCharCount, rightToLeft, rightToLeft, > +- glyphStorage, success); > +- // FIXME: a subclass may have allocated this, in which case this delete > +- // might not work... > +- LE_DELETE_ARRAY(outChars); > ++ mapCharsToGlyphs(outChars, 0, outCharCount, rightToLeft, rightToLeft, glyphStorage, success); > ++ LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... > + } else { > +- mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, > +- glyphStorage, success); > ++ mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, glyphStorage, success); > + } > + > + return glyphStorage.getGlyphCount(); > +@@ -341,8 +325,7 @@ > + > + // Input: glyphs > + // Output: positions > +-void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, > +- float x, float y, LEErrorCode &success) > ++void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -369,9 +352,8 @@ > + glyphStorage.setPosition(glyphCount, x, y, success); > + } > + > +-void LayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void LayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -398,8 +380,7 @@ > + return; > + } > + > +-void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, > +- LEGlyphFilter *markFilter, LEErrorCode &success) > ++void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success) > + { > + float xAdjust = 0; > + le_int32 p, glyphCount = glyphStorage.getGlyphCount(); > +@@ -435,9 +416,7 @@ > + glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success); > + } > + > +-void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, > +- le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, > +- LEErrorCode &success) > ++void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success) > + { > + float xAdjust = 0; > + le_int32 c = 0, direction = 1, p; > +@@ -484,9 +463,8 @@ > + return fFontInstance->getFontTable(tableTag); > + } > + > +-void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, le_bool mirror, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -496,32 +474,27 @@ > + > + DefaultCharMapper charMapper(TRUE, mirror); > + > +- fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, > +- &charMapper, glyphStorage); > ++ fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, &charMapper, glyphStorage); > + } > + > + // Input: characters, font? > + // Output: glyphs, positions, char indices > + // Returns: number of glyphs > +-le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- float x, float y, LEErrorCode &success) > ++le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ float x, float y, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || > +- offset + count > max) { > +- > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > + > + le_int32 glyphCount; > + > +- glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, > +- *fGlyphStorage, success); > ++ glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, *fGlyphStorage, success); > + positionGlyphs(*fGlyphStorage, x, y, success); > + adjustGlyphPositions(chars, offset, count, rightToLeft, *fGlyphStorage, success); > + > +@@ -533,17 +506,13 @@ > + fGlyphStorage->reset(); > + } > + > +-LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success) > ++LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success) > + { > + // 3 -> kerning and ligatures > +- return LayoutEngine::layoutEngineFactory(fontInstance, scriptCode, > +- languageCode, 3, success); > ++ return LayoutEngine::layoutEngineFactory(fontInstance, scriptCode, languageCode, 3, success); > + } > + > +-LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- LEErrorCode &success) > ++LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success) > + { > + static const le_uint32 gsubTableTag = LE_GSUB_TABLE_TAG; > + static const le_uint32 mortTableTag = LE_MORT_TABLE_TAG; > +@@ -552,18 +521,12 @@ > + return NULL; > + } > + > +- // code2000 has GPOS kern feature tags for latn script > +- > +- const GlyphSubstitutionTableHeader *gsubTable = > +- (const GlyphSubstitutionTableHeader *) fontInstance->getFontTable(gsubTableTag); > ++ const GlyphSubstitutionTableHeader *gsubTable = (const GlyphSubstitutionTableHeader *) fontInstance->getFontTable(gsubTableTag); > + LayoutEngine *result = NULL; > + LETag scriptTag = 0x00000000; > + LETag languageTag = 0x00000000; > + > +- if (gsubTable != NULL && > +- gsubTable->coversScript(scriptTag = > +- OpenTypeLayoutEngine::getScriptTag(scriptCode))) { > +- > ++ if (gsubTable != NULL && gsubTable->coversScript(scriptTag = OpenTypeLayoutEngine::getScriptTag(scriptCode))) { > + switch (scriptCode) { > + case bengScriptCode: > + case devaScriptCode: > +@@ -575,13 +538,11 @@ > + case tamlScriptCode: > + case teluScriptCode: > + case sinhScriptCode: > +- result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + > + case arabScriptCode: > +- result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + > + case haniScriptCode: > +@@ -593,33 +554,33 @@ > + case zhtLanguageCode: > + case zhsLanguageCode: > + if (gsubTable->coversScriptAndLanguage(scriptTag, languageTag, TRUE)) { > +- result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + } > + > + // note: falling through to default case. > + default: > +- result = new OpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + } > + > + break; > ++#if 0 > ++ case tibtScriptCode: > ++ result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > ++ break; > ++#endif > + > + case khmrScriptCode: > +- result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + > + default: > +- result = new OpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags, gsubTable); > ++ result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); > + break; > + } > + } else { > +- const MorphTableHeader *morphTable = > +- (MorphTableHeader *) fontInstance->getFontTable(mortTableTag); > ++ const MorphTableHeader *morphTable = (MorphTableHeader *) fontInstance->getFontTable(mortTableTag); > + > + if (morphTable != NULL) { > + result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, morphTable); > +@@ -636,16 +597,18 @@ > + case teluScriptCode: > + case sinhScriptCode: > + { > +- result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags); > ++ result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); > + break; > + } > + > + case arabScriptCode: > +- result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, > +- languageCode, typoFlags); > ++ //case hebrScriptCode: > ++ result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); > + break; > + > ++ //case hebrScriptCode: > ++ // return new HebrewOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); > ++ > + case thaiScriptCode: > + result = new ThaiLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); > + break; > +@@ -667,3 +630,5 @@ > + LayoutEngine::~LayoutEngine() { > + delete fGlyphStorage; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,6 +23,7 @@ > + * > + */ > + > ++ > + /* > + * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > +@@ -34,63 +35,61 @@ > + > + #include "LETypes.h" > + > +-#include > ++/** > ++ * \file > ++ * \brief C++ API: Virtual base class for complex text layout. > ++ */ > ++ > ++U_NAMESPACE_BEGIN > + > + class LEFontInstance; > + class LEGlyphFilter; > + class LEGlyphStorage; > + > + /** > +- * This is a virtual base class used to do complex text layout. The > +- * text must all be in a single font, script, and language. An > +- * instance of a LayoutEngine can be created by calling the > +- * layoutEngineFactory method. Fonts are identified by instances of > +- * the LEFontInstance class. Script and language codes are identified > ++ * This is a virtual base class used to do complex text layout. The text must all > ++ * be in a single font, script, and language. An instance of a LayoutEngine can be > ++ * created by calling the layoutEngineFactory method. Fonts are identified by > ++ * instances of the LEFontInstance class. Script and language codes are identified > + * by integer codes, which are defined in ScriptAndLanuageTags.h. > + * > +- * Note that this class is not public API. It is declared public so > +- * that it can be exported from the library that it is a part of. > ++ * Note that this class is not public API. It is declared public so that it can be > ++ * exported from the library that it is a part of. > + * > +- * The input to the layout process is an array of characters in > +- * logical order, and a starting X, Y position for the text. The > +- * output is an array of glyph indices, an array of character indices > +- * for the glyphs, and an array of glyph positions. These arrays are > +- * protected members of LayoutEngine which can be retreived by a > +- * public method. The reset method can be called to free these arrays > +- * so that the LayoutEngine can be reused. > ++ * The input to the layout process is an array of characters in logical order, > ++ * and a starting X, Y position for the text. The output is an array of glyph indices, > ++ * an array of character indices for the glyphs, and an array of glyph positions. > ++ * These arrays are protected members of LayoutEngine which can be retreived by a > ++ * public method. The reset method can be called to free these arrays so that the > ++ * LayoutEngine can be reused. > + * > +- * The layout process is done in three steps. There is a protected > +- * virtual method for each step. These methods have a default > +- * implementation which only does character to glyph mapping and > +- * default positioning using the glyph's advance widths. Subclasses > +- * can override these methods for more advanced layout. There is a > +- * public method which invokes the steps in the correct order. > ++ * The layout process is done in three steps. There is a protected virtual method > ++ * for each step. These methods have a default implementation which only does > ++ * character to glyph mapping and default positioning using the glyph's advance > ++ * widths. Subclasses can override these methods for more advanced layout. > ++ * There is a public method which invokes the steps in the correct order. > + * > + * The steps are: > + * > +- * 1) Glyph processing - character to glyph mapping and any other > +- * glyph processing such as ligature substitution and contextual > +- * forms. > ++ * 1) Glyph processing - character to glyph mapping and any other glyph processing > ++ * such as ligature substitution and contextual forms. > + * > +- * 2) Glyph positioning - position the glyphs based on their advance > +- * widths. > ++ * 2) Glyph positioning - position the glyphs based on their advance widths. > + * > +- * 3) Glyph position adjustments - adjustment of glyph positions for > +- * kerning, accent placement, etc. > ++ * 3) Glyph position adjustments - adjustment of glyph positions for kerning, > ++ * accent placement, etc. > + * > +- * NOTE: in all methods below, output parameters are references to > +- * pointers so the method can allocate and free the storage as > +- * needed. All storage allocated in this way is owned by the object > +- * which created it, and will be freed when it is no longer needed, or > +- * when the object's destructor is invoked. > ++ * NOTE: in all methods below, output parameters are references to pointers so > ++ * the method can allocate and free the storage as needed. All storage allocated > ++ * in this way is owned by the object which created it, and will be freed when it > ++ * is no longer needed, or when the object's destructor is invoked. > + * > + * @see LEFontInstance > + * @see ScriptAndLanguageTags.h > + * > + * @stable ICU 2.8 > + */ > +-class U_LAYOUT_API LayoutEngine > +-{ > ++class U_LAYOUT_API LayoutEngine : public UObject { > + protected: > + /** > + * The object which holds the glyph storage > +@@ -134,21 +133,21 @@ > + le_int32 fTypoFlags; > + > + /** > +- * This constructs an instance for a given font, script and > +- * language. Subclass constructors > ++ * This constructs an instance for a given font, script and language. Subclass constructors > + * must call this constructor. > + * > + * @param fontInstance - the font for the text > + * @param scriptCode - the script for the text > + * @param languageCode - the language for the text > ++ * @param typoFlags - the typographic control flags for the text. Set bit 1 if kerning > ++ * is desired, set bit 2 if ligature formation is desired. Others are reserved. > + * > + * @see LEFontInstance > + * @see ScriptAndLanguageTags.h > + * > + * @internal > + */ > +- LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, le_int32 typoFlags); > ++ LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > + > + /** > + * This overrides the default no argument constructor to make it > +@@ -160,11 +159,10 @@ > + LayoutEngine(); > + > + /** > +- * This method does any required pre-processing to the input > +- * characters. It may generate output characters that differ from > +- * the input charcters due to insertions, deletions, or > +- * reorderings. In such cases, it will also generate an output > +- * character index array reflecting these changes. > ++ * This method does any required pre-processing to the input characters. It > ++ * may generate output characters that differ from the input charcters due to > ++ * insertions, deletions, or reorderings. In such cases, it will also generate an > ++ * output character index array reflecting these changes. > + * > + * Subclasses must override this method. > + * > +@@ -173,44 +171,36 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the characters are in a right to > +- * left directional run > +- * @param outChars - the output character array, if different from > +- * the input > +- * @param glyphStorage - the object that holds the per-glyph > +- * storage. The character index array may be set. > ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run > ++ * @param outChars - the output character array, if different from the input > ++ * @param glyphStorage - the object that holds the per-glyph storage. The character index array may be set. > + * @param success - set to an error code if the operation fails > +- * @return the output character count (input character count if no > +- * change) > ++ * > ++ * @return the output character count (input character count if no change) > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +- * This method does the glyph processing. It converts an array of > +- * characters into an array of glyph indices and character > +- * indices. The characters to be processed are passed in a > +- * surrounding context. The context is specified as a starting > +- * address and a maximum character count. An offset and a count > +- * are used to specify the characters to be processed. > ++ * This method does the glyph processing. It converts an array of characters > ++ * into an array of glyph indices and character indices. The characters to be > ++ * processed are passed in a surrounding context. The context is specified as > ++ * a starting address and a maximum character count. An offset and a count are > ++ * used to specify the characters to be processed. > + * > +- * The default implementation of this method only does character > +- * to glyph mapping. Subclasses needing more elaborate glyph > +- * processing must override this method. > ++ * The default implementation of this method only does character to glyph mapping. > ++ * Subclasses needing more elaborate glyph processing must override this method. > + * > + * Input parameters: > + * @param chars - the character context > + * @param offset - the offset of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the context. > +- * @param rightToLeft - TRUE if the text is in a right to left > +- * directional run > +- * @param glyphStorage - the object which holds the per-glyph > +- * storage. The glyph and char indices arrays will be > +- * set. > ++ * @param rightToLeft - TRUE if the text is in a right to left directional run > ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph and char indices arrays > ++ * will be set. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -219,60 +209,50 @@ > + * > + * @internal > + */ > +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +- * This method does basic glyph positioning. The default > +- * implementation positions the glyphs based on their advance > +- * widths. This is sufficient for most uses. It is not expected > +- * that many subclasses will override this method. > ++ * This method does basic glyph positioning. The default implementation positions > ++ * the glyphs based on their advance widths. This is sufficient for most uses. It > ++ * is not expected that many subclasses will override this method. > + * > + * Input parameters: > +- * @param glyphStorage - the object which holds the per-glyph storage. > +- * The glyph position array will be set. > ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph position array will be set. > + * @param x - the starting X position > + * @param y - the starting Y position > + * @param success - set to an error code if the operation fails > + * > + * @internal > + */ > +- virtual void positionGlyphs(LEGlyphStorage &glyphStorage, > +- float x, float y, LEErrorCode &success); > ++ virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success); > + > + /** > +- * This method does positioning adjustments like accent > +- * positioning and kerning. The default implementation does > +- * nothing. Subclasses needing position adjustments must override > +- * this method. > ++ * This method does positioning adjustments like accent positioning and > ++ * kerning. The default implementation does nothing. Subclasses needing > ++ * position adjustments must override this method. > + * > +- * Note that this method has both characters and glyphs as input > +- * so that it can use the character codes to determine glyph types > +- * if that information isn't directly available. (e.g. Some Arabic > +- * OpenType fonts don't have a GDEF table) > ++ * Note that this method has both characters and glyphs as input so that > ++ * it can use the character codes to determine glyph types if that information > ++ * isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF > ++ * table) > + * > + * @param chars - the input character context > + * @param offset - the offset of the first character to process > + * @param count - the number of characters to process > +- * @param reverse - TRUE if the glyphs in the glyph > +- * array have been reordered > +- * @param glyphStorage - the object which holds the per-glyph > +- * storage. The glyph positions will be adjusted as needed. > +- * @param success - output parameter set to an error code if the > +- * operation fails > ++ * @param reverse - TRUE if the glyphs in the glyph array have been reordered > ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be > ++ * adjusted as needed. > ++ * @param success - output parameter set to an error code if the operation fails > + * > + * @internal > + */ > +- virtual void adjustGlyphPositions(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_bool reverse, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +- * This method gets a table from the font associated with the > +- * text. The default implementation gets the table from the font > +- * instance. Subclasses which need to get the tables some other > +- * way must override this method. > ++ * This method gets a table from the font associated with > ++ * the text. The default implementation gets the table from > ++ * the font instance. Subclasses which need to get the tables > ++ * some other way must override this method. > + * > + * @param tableTag - the four byte table tag. > + * > +@@ -283,127 +263,106 @@ > + virtual const void *getFontTable(LETag tableTag) const; > + > + /** > +- * This method does character to glyph mapping. The default > +- * implementation uses the font instance to do the mapping. It > +- * will allocate the glyph and character index arrays if they're > +- * not already allocated. If it allocates the character index > +- * array, it will fill it it. > ++ * This method does character to glyph mapping. The default implementation > ++ * uses the font instance to do the mapping. It will allocate the glyph and > ++ * character index arrays if they're not already allocated. If it allocates the > ++ * character index array, it will fill it it. > + * > +- * This method supports right to left text with the ability to > +- * store the glyphs in reverse order, and by supporting character > +- * mirroring, which will replace a character which has a left and > +- * right form, such as parens, with the opposite form before > +- * mapping it to a glyph index. > ++ * This method supports right to left > ++ * text with the ability to store the glyphs in reverse order, and by supporting > ++ * character mirroring, which will replace a character which has a left and right > ++ * form, such as parens, with the opposite form before mapping it to a glyph index. > + * > + * Input parameters: > + * @param chars - the input character context > + * @param offset - the offset of the first character to be mapped > + * @param count - the number of characters to be mapped > +- * @param reverse - if TRUE, the output will be in > +- * reverse order > ++ * @param reverse - if TRUE, the output will be in reverse order > + * @param mirror - if TRUE, do character mirroring > +- * @param glyphStorage - the object which holds the per-glyph > +- * storage. The glyph and char indices arrays will be > +- * filled in. > ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph and char > ++ * indices arrays will be filled in. > + * @param success - set to an error code if the operation fails > + * > + * @see LEFontInstance > + * > + * @internal > + */ > +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, le_bool mirror, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > +- * This is a convenience method that forces the advance width of > +- * mark glyphs to be zero, which is required for proper selection > +- * and highlighting. > ++ * This is a convenience method that forces the advance width of mark > ++ * glyphs to be zero, which is required for proper selection and highlighting. > + * > +- * @param glyphStorage - the object containing the per-glyph > +- * storage. The positions array will be modified. > ++ * @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified. > + * @param markFilter - used to identify mark glyphs > +- * @param success - output parameter set to an error code if the > +- * operation fails > ++ * @param success - output parameter set to an error code if the operation fails > + * > + * @see LEGlyphFilter > + * > + * @internal > + */ > +- static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, > +- LEGlyphFilter *markFilter, LEErrorCode &success); > ++ static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); > + > + > + /** > +- * This is a convenience method that forces the advance width of > +- * mark glyphs to be zero, which is required for proper selection > +- * and highlighting. This method uses the input characters to > +- * identify marks. This is required in cases where the font does > +- * not contain enough information to identify them based on the > +- * glyph IDs. > ++ * This is a convenience method that forces the advance width of mark > ++ * glyphs to be zero, which is required for proper selection and highlighting. > ++ * This method uses the input characters to identify marks. This is required in > ++ * cases where the font does not contain enough information to identify them based > ++ * on the glyph IDs. > + * > + * @param chars - the array of input characters > + * @param charCount - the number of input characers > +- * @param glyphStorage - the object containing the per-glyph > +- * storage. The positions array will be modified. > +- * @param reverse - TRUE if the glyph array has been > +- * reordered > ++ * @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified. > ++ * @param reverse - TRUE if the glyph array has been reordered > + * @param markFilter - used to identify mark glyphs > +- * @param success - output parameter set to an error code if the > +- * operation fails > ++ * @param success - output parameter set to an error code if the operation fails > + * > + * @see LEGlyphFilter > + * > + * @internal > + */ > +- static void adjustMarkGlyphs(const LEUnicode chars[], > +- le_int32 charCount, le_bool reverse, > +- LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, > +- LEErrorCode &success); > ++ static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); > ++ > + > + public: > + /** > + * The destructor. It will free any storage allocated for the > + * glyph, character index and position arrays by calling the reset > +- * method. It is declared virtual so that it will be invoked by > +- * the subclass destructors. > ++ * method. It is declared virtual so that it will be invoked by the > ++ * subclass destructors. > + * > + * @stable ICU 2.8 > + */ > + virtual ~LayoutEngine(); > + > + /** > +- * This method will invoke the layout steps in their correct order > +- * by calling the 32 bit versions of the computeGlyphs and > +- * positionGlyphs methods.(It doesn't * call the > +- * adjustGlyphPositions method because that doesn't apply for > +- * default * processing.) It will compute the glyph, character > +- * index and position arrays. > ++ * This method will invoke the layout steps in their correct order by calling > ++ * the computeGlyphs, positionGlyphs and adjustGlyphPosition methods.. It will > ++ * compute the glyph, character index and position arrays. > + * > + * @param chars - the input character context > + * @param offset - the offset of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - true if the characers are in a right to > +- * left directional run > ++ * @param rightToLeft - TRUE if the characers are in a right to left directional run > + * @param x - the initial X position > + * @param y - the initial Y position > +- * @param success - output parameter set to an error code if the > +- * operation fails > ++ * @param success - output parameter set to an error code if the operation fails > ++ * > + * @return the number of glyphs in the glyph array > + * > +- * Note: the glyph, character index and position array can be > +- * accessed using the getter method below. > ++ * Note; the glyph, character index and position array can be accessed > ++ * using the getter method below. > ++ * > ++ * @stable ICU 2.8 > + */ > +- le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, float x, > +- float y, LEErrorCode &success); > ++ virtual le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success); > + > + /** > +- * This method returns the number of glyphs in the glyph > +- * array. Note that the number of glyphs will be greater than or > +- * equal to the number of characters used to create the > +- * LayoutEngine. > ++ * This method returns the number of glyphs in the glyph array. Note > ++ * that the number of glyphs will be greater than or equal to the number > ++ * of characters used to create the LayoutEngine. > + * > + * @return the number of glyphs in the glyph array > + * > +@@ -412,9 +371,9 @@ > + le_int32 getGlyphCount() const; > + > + /** > +- * This method copies the glyph array into a caller supplied > +- * array. The caller must ensure that the array is large enough > +- * to hold all the glyphs. > ++ * This method copies the glyph array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold all > ++ * the glyphs. > + * > + * @param glyphs - the destiniation glyph array > + * @param success - set to an error code if the operation fails > +@@ -424,10 +383,10 @@ > + void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; > + > + /** > +- * This method copies the glyph array into a caller supplied > +- * array, ORing in extra bits. (This functionality is needed by > +- * the JDK, which uses 32 bits pre glyph idex, with the high 16 > +- * bits encoding the composite font slot number) > ++ * This method copies the glyph array into a caller supplied array, > ++ * ORing in extra bits. (This functionality is needed by the JDK, > ++ * which uses 32 bits pre glyph idex, with the high 16 bits encoding > ++ * the composite font slot number) > + * > + * @param glyphs - the destination (32 bit) glyph array > + * @param extraBits - this value will be ORed with each glyph index > +@@ -435,13 +394,12 @@ > + * > + * @stable ICU 2.8 > + */ > +- virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, > +- LEErrorCode &success) const; > ++ virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; > + > + /** > +- * This method copies the character index array into a caller > +- * supplied array. The caller must ensure that the array is large > +- * enough to hold a character index for each glyph. > ++ * This method copies the character index array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold a > ++ * character index for each glyph. > + * > + * @param charIndices - the destiniation character index array > + * @param success - set to an error code if the operation fails > +@@ -451,9 +409,9 @@ > + void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; > + > + /** > +- * This method copies the character index array into a caller > +- * supplied array. The caller must ensure that the array is large > +- * enough to hold a character index for each glyph. > ++ * This method copies the character index array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold a > ++ * character index for each glyph. > + * > + * @param charIndices - the destiniation character index array > + * @param indexBase - an offset which will be added to each index > +@@ -461,14 +419,13 @@ > + * > + * @stable ICU 2.8 > + */ > +- void getCharIndices(le_int32 charIndices[], le_int32 indexBase, > +- LEErrorCode &success) const; > ++ void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; > + > + /** > +- * This method copies the position array into a caller supplied > +- * array. The caller must ensure that the array is large enough > +- * to hold an X and Y position for each glyph, plus an extra X and > +- * Y for the advance of the last glyph. > ++ * This method copies the position array into a caller supplied array. > ++ * The caller must ensure that the array is large enough to hold an > ++ * X and Y position for each glyph, plus an extra X and Y for the > ++ * advance of the last glyph. > + * > + * @param positions - the destiniation position array > + * @param success - set to an error code if the operation fails > +@@ -491,8 +448,7 @@ > + * > + * @stable ICU 2.8 > + */ > +- void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, > +- LEErrorCode &success) const; > ++ void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; > + > + /** > + * This method frees the glyph, character index and position arrays > +@@ -511,8 +467,7 @@ > + * @param fontInstance - the font of the text > + * @param scriptCode - the script of the text > + * @param languageCode - the language of the text > +- * @param success - output parameter set to an error code if the > +- * operation fails > ++ * @param success - output parameter set to an error code if the operation fails > + * > + * @return a LayoutEngine which can layout text in the given font. > + * > +@@ -520,17 +475,30 @@ > + * > + * @stable ICU 2.8 > + */ > +- static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); > ++ static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); > + > + /** > + * Override of existing call that provides flags to control typography. > + * @draft ICU 3.4 > + */ > +- static LayoutEngine *layoutEngineFactory( > +- const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, > +- le_int32 typo_flags, LEErrorCode &success); > ++ static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success); > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,20 @@ > + #ifndef __LAYOUTTABLES_H > + #define __LAYOUTTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define ANY_NUMBER 1 > + > + typedef le_int16 ByteOffset; > + typedef le_int16 WordOffset; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstProc.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,10 +39,14 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define ExtendedComplement(m) ((le_int32) (~((le_uint32) (m)))) > + #define SignBit(m) ((ExtendedComplement(m) >> 1) & (le_int32)(m)) > + #define SignExtend(v,m) (((v) & SignBit(m))? ((v) | ExtendedComplement(m)): (v)) > + > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LigatureSubstitutionProcessor) > ++ > + LigatureSubstitutionProcessor::LigatureSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader) > + : StateTableProcessor(morphSubtableHeader) > + { > +@@ -63,8 +67,7 @@ > + m = -1; > + } > + > +-ByteOffset LigatureSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, > +- le_int32 &currGlyph, EntryTableIndex index) > ++ByteOffset LigatureSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) > + { > + const LigatureSubstitutionStateEntry *entry = &entryTable[index]; > + ByteOffset newState = SWAPW(entry->newStateOffset); > +@@ -135,3 +138,5 @@ > + void LigatureSubstitutionProcessor::endStateTable() > + { > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstProc.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstProc.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstProc.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __LIGATURESUBSTITUTIONPROCESSOR_H > + #define __LIGATURESUBSTITUTIONPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "StateTableProcessor.h" > + #include "LigatureSubstitution.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + #define nComponents 16 > +@@ -54,6 +61,20 @@ > + LigatureSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader); > + virtual ~LigatureSubstitutionProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + LigatureSubstitutionProcessor(); > + > +@@ -68,6 +89,8 @@ > + le_int16 m; > + > + const LigatureSubstitutionHeader *ligatureSubstitutionHeader; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved > + * > + */ > +@@ -37,6 +38,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 LigatureSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const > + { > + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); > +@@ -92,3 +95,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __LIGATURESUBSTITUTIONSUBTABLES_H > + #define __LIGATURESUBSTITUTIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "OpenTypeTables.h" > + #include "GlyphSubstitutionTables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct LigatureSetTable > + { > + le_uint16 ligatureCount; > +@@ -59,4 +66,5 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstitution.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstitution.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstitution.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __LIGATURESUBSTITUTION_H > + #define __LIGATURESUBSTITUTION_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "StateTables.h" > + #include "MorphTables.h" > + #include "MorphStateTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct LigatureSubstitutionHeader : MorphStateTableHeader > + { > + ByteOffset ligatureActionTableOffset; > +@@ -65,4 +72,5 @@ > + lafComponentOffsetMask = 0x3FFFFFFF > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -42,6 +42,8 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, > + const LEFontInstance *fontInstance) const > + { > +@@ -65,10 +67,9 @@ > + return 1; > + } > + > +-le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, > +- GlyphPositionAdjustments *glyphPositionAdjustments, > +- le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEFontInstance *fontInstance) const > ++le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, > ++ le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > ++ const LEFontInstance *fontInstance) const > + { > + le_int32 glyphCount = glyphStorage.getGlyphCount(); > + > +@@ -133,8 +134,7 @@ > + > + LookupProcessor::LookupProcessor(const char *baseAddress, > + Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, > +- LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, > +- le_int32 featureMapCount, le_bool orderFeatures) > ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures) > + : lookupListTable(NULL), featureListTable(NULL), lookupSelectArray(NULL), > + lookupOrderArray(NULL), lookupOrderCount(0) > + { > +@@ -296,3 +296,5 @@ > + LE_DELETE_ARRAY(lookupOrderArray); > + LE_DELETE_ARRAY(lookupSelectArray); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -32,9 +33,18 @@ > + #ifndef __LOOKUPPROCESSOR_H > + #define __LOOKUPPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > ++//#include "Lookups.h" > ++//#include "Features.h" > ++ > ++U_NAMESPACE_BEGIN > + > + class LEFontInstance; > + class LEGlyphStorage; > +@@ -46,13 +56,10 @@ > + struct LookupSubtable; > + struct LookupTable; > + > +-class LookupProcessor > +-{ > ++class LookupProcessor : public UMemory { > + public: > +- le_int32 process(LEGlyphStorage &glyphStorage, > +- GlyphPositionAdjustments *glyphPositionAdjustments, > +- le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, > +- const LEFontInstance *fontInstance) const; > ++ le_int32 process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, > ++ le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEFontInstance *fontInstance) const; > + > + le_uint32 applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + > +@@ -64,19 +71,18 @@ > + virtual ~LookupProcessor(); > + > + protected: > +- LookupProcessor(const char *baseAddress, > ++ LookupProcessor(const char *baseAddress, > + Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, > +- LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, > +- le_int32 featureMapCount, le_bool orderFeatures); > ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures); > + > +- LookupProcessor(); > ++ LookupProcessor(); > + > + le_int32 selectLookups(const FeatureTable *featureTable, FeatureMask featureMask, le_int32 order); > + > + const LookupListTable *lookupListTable; > + const FeatureListTable *featureListTable; > + > +- FeatureMask *lookupSelectArray; > ++ FeatureMask *lookupSelectArray; > + > + le_uint16 *lookupOrderArray; > + le_uint32 lookupOrderCount; > +@@ -87,4 +93,5 @@ > + LookupProcessor &operator=(const LookupProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "LookupTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /* > + These are the rolled-up versions of the uniform binary search. > + Someday, if we need more performance, we can un-roll them. > +@@ -104,3 +106,5 @@ > + > + return NULL; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __LOOKUPTABLES_H > + #define __LOOKUPTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + enum LookupTableFormat > + { > + ltfSimpleArray = 0, > +@@ -104,4 +111,5 @@ > + LookupValue valueArray[ANY_NUMBER]; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Lookups.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Lookups.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/Lookups.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "CoverageTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const LookupTable *LookupListTable::getLookupTable(le_uint16 lookupTableIndex) const > + { > + if (lookupTableIndex >= SWAPW(lookupCount)) { > +@@ -63,3 +65,5 @@ > + > + return coverageTable->getGlyphCoverage(glyphID); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Lookups.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Lookups.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/Lookups.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __LOOKUPS_H > + #define __LOOKUPS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + enum LookupFlags > + { > + lfBaselineIsLogicalEnd = 0x0001, // The MS spec. calls this flag "RightToLeft" but this name is more accurate > +@@ -79,6 +86,5 @@ > + return getGlyphCoverage(coverageTableOffset, glyphID); > + } > + > +- > +- > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MPreFixups.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MPreFixups.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MPreFixups.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -33,6 +33,8 @@ > + #include "LEGlyphStorage.h" > + #include "MPreFixups.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct FixupData > + { > + le_int32 fBaseIndex; > +@@ -92,7 +94,7 @@ > + > + for (i = 0; i < mpreCount; i += 1) { > + mpreSave[i] = glyphStorage[mpreIndex + i]; > +- indexSave[i] = glyphStorage.getCharIndex(mpreIndex + i, success); > ++ indexSave[i] = glyphStorage.getCharIndex(mpreIndex + i, success); //charIndices[mpreIndex + i]; > + } > + > + for (i = 0; i < moveCount; i += 1) { > +@@ -112,3 +114,5 @@ > + LE_DELETE_ARRAY(mpreSave); > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MPreFixups.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MPreFixups.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MPreFixups.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,14 +32,22 @@ > + #ifndef __MPREFIXUPS_H > + #define __MPREFIXUPS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + // Might want to make this a private member... > + struct FixupData; > + > +-class MPreFixups { > ++class MPreFixups : public UMemory > ++{ > + public: > + MPreFixups(le_int32 charCount); > + ~MPreFixups(); > +@@ -53,4 +61,7 @@ > + le_int32 fFixupCount; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkArrays.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkArrays.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkArrays.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,8 @@ > + #include "MarkArrays.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance, > + LEPoint &anchor) const > + { > +@@ -58,3 +60,5 @@ > + > + return markClass; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkArrays.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkArrays.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkArrays.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,10 +32,17 @@ > + #ifndef __MARKARRAYS_H > + #define __MARKARRAYS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct MarkRecord > + { > + le_uint16 markClass; > +@@ -51,4 +58,7 @@ > + LEPoint &anchor) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -40,6 +40,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + LEGlyphID MarkToBasePositioningSubtable::findBaseGlyph(GlyphIterator *glyphIterator) const > + { > + if (glyphIterator->prev()) { > +@@ -106,7 +108,6 @@ > + glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); > + > + if (glyphIterator->isRightToLeft()) { > +- // dlf flip advance to local coordinate system > + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); > + } else { > + LEPoint baseAdvance; > +@@ -114,9 +115,10 @@ > + fontInstance->getGlyphAdvance(baseGlyph, pixels); > + fontInstance->pixelsToUnits(pixels, baseAdvance); > + > +- // flip advances to local coordinate system > + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); > + } > + > + return 1; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToBasePosnSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __MARKTOBASEPOSITIONINGSUBTABLES_H > + #define __MARKTOBASEPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "AttachmentPosnSubtables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct MarkToBasePositioningSubtable : AttachmentPositioningSubtable > + { > + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > +@@ -56,4 +63,6 @@ > + BaseRecord baseRecordArray[ANY_NUMBER]; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + LEGlyphID MarkToLigaturePositioningSubtable::findLigatureGlyph(GlyphIterator *glyphIterator) const > + { > + if (glyphIterator->prev()) { > +@@ -117,9 +119,10 @@ > + fontInstance->getGlyphAdvance(ligatureGlyph, pixels); > + fontInstance->pixelsToUnits(pixels, ligatureAdvance); > + > +- glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - ligatureAdvance.fX, > +- anchorDiffY - ligatureAdvance.fY, -markAdvance.fX, -markAdvance.fY); > ++ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - ligatureAdvance.fX, anchorDiffY - ligatureAdvance.fY, -markAdvance.fX, -markAdvance.fY); > + } > + > + return 1; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __MARKTOLIGATUREPOSITIONINGSUBTABLES_H > + #define __MARKTOLIGATUREPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "AttachmentPosnSubtables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct MarkToLigaturePositioningSubtable : AttachmentPositioningSubtable > + { > + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > +@@ -62,4 +69,6 @@ > + Offset ligatureAttachTableOffsetArray[ANY_NUMBER]; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -40,6 +40,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + LEGlyphID MarkToMarkPositioningSubtable::findMark2Glyph(GlyphIterator *glyphIterator) const > + { > + if (glyphIterator->findMark2Glyph()) { > +@@ -88,7 +90,7 @@ > + const AnchorTable *anchorTable = (const AnchorTable *) ((char *) mark2Array + anchorTableOffset); > + LEPoint mark2Anchor, markAdvance, pixels; > + > +- if (anchorTableOffset == 0) { // jb4729 > ++ if (anchorTableOffset == 0) { > + // this seems to mean that the marks don't attach... > + return 0; > + } > +@@ -111,9 +113,10 @@ > + fontInstance->getGlyphAdvance(mark2Glyph, pixels); > + fontInstance->pixelsToUnits(pixels, mark2Advance); > + > +- glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - mark2Advance.fX, > +- anchorDiffY - mark2Advance.fY, -markAdvance.fX, -markAdvance.fY); > ++ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - mark2Advance.fX, anchorDiffY - mark2Advance.fY, -markAdvance.fX, -markAdvance.fY); > + } > + > + return 1; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __MARKTOMARKPOSITIONINGSUBTABLES_H > + #define __MARKTOMARKPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "AttachmentPosnSubtables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct MarkToMarkPositioningSubtable : AttachmentPositioningSubtable > + { > + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > +@@ -56,4 +63,6 @@ > + Mark2Record mark2RecordArray[ANY_NUMBER]; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MirroredCharData.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MirroredCharData.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MirroredCharData.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,8 @@ > + #include "LETypes.h" > + #include "DefaultCharMapper.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const LEUnicode32 DefaultCharMapper::mirroredChars[] = { > + 0x0028, 0x0029, 0x003C, 0x003E, 0x005B, 0x005D, 0x007B, 0x007D, > + 0x00AB, 0x00BB, 0x2039, 0x203A, 0x2045, 0x2046, 0x207D, 0x207E, > +@@ -127,3 +129,5 @@ > + }; > + > + const le_int32 DefaultCharMapper::mirroredCharsCount = 332; > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphStateTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphStateTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphStateTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,14 +32,22 @@ > + #ifndef __MORPHSTATETABLES_H > + #define __MORPHSTATETABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "MorphTables.h" > + #include "StateTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct MorphStateTableHeader : MorphSubtableHeader > + { > + StateTableHeader stHeader; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -42,6 +42,8 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + void MorphTableHeader::process(LEGlyphStorage &glyphStorage) const > + { > + const ChainHeader *chainHeader = chains; > +@@ -114,3 +116,5 @@ > + delete processor; > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __MORPHTABLES_H > + #define __MORPHTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + typedef le_uint32 FeatureFlags; > +@@ -98,4 +105,6 @@ > + void process(LEGlyphStorage &glyphStorage) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MultipleSubstSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const > + { > + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); > +@@ -106,3 +108,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MultipleSubstSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __MULTIPLESUBSTITUTIONSUBTABLES_H > + #define __MULTIPLESUBSTITUTIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "OpenTypeTables.h" > + #include "GlyphSubstitutionTables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct SequenceTable > + { > + le_uint16 glyphCount; > +@@ -52,4 +59,5 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubst.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubst.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubst.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved > + * > + */ > +@@ -32,14 +33,23 @@ > + #ifndef __NONCONTEXTUALGLYPHSUBSTITUTION_H > + #define __NONCONTEXTUALGLYPHSUBSTITUTION_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + #include "LookupTables.h" > + #include "MorphTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct NonContextualGlyphSubstitutionHeader : MorphSubtableHeader > + { > + LookupTable table; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -41,6 +41,8 @@ > + #include "TrimmedArrayProcessor.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + NonContextualGlyphSubstitutionProcessor::NonContextualGlyphSubstitutionProcessor() > + { > + } > +@@ -79,3 +81,5 @@ > + return NULL; > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,18 @@ > + #ifndef __NONCONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H > + #define __NONCONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class NonContextualGlyphSubstitutionProcessor : public SubtableProcessor > +@@ -57,4 +64,5 @@ > + NonContextualGlyphSubstitutionProcessor &operator=(const NonContextualGlyphSubstitutionProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -47,6 +47,10 @@ > + > + #include "GDEFMarkFilter.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(OpenTypeLayoutEngine) > ++ > + #define ccmpFeatureTag LE_CCMP_FEATURE_TAG > + #define ligaFeatureTag LE_LIGA_FEATURE_TAG > + #define cligFeatureTag LE_CLIG_FEATURE_TAG > +@@ -78,7 +82,7 @@ > + {ccmpFeatureTag, ccmpFeatureMask}, > + {ligaFeatureTag, ligaFeatureMask}, > + {cligFeatureTag, cligFeatureMask}, > +- {kernFeatureTag, kernFeatureMask}, > ++ {kernFeatureTag, kernFeatureMask}, > + {paltFeatureTag, paltFeatureMask}, > + {markFeatureTag, markFeatureMask}, > + {mkmkFeatureTag, mkmkFeatureMask} > +@@ -86,19 +90,15 @@ > + > + static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); > + > +-OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, > +- const GlyphSubstitutionTableHeader *gsubTable) > +- : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), > +- fFeatureMask(minimalFeatures), fFeatureMap(featureMap), > +- fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE), > +- fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), > +- fSubstitutionFilter(NULL) > ++OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) > ++ : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureMask(minimalFeatures), > ++ fFeatureMap(featureMap), fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE), > ++ fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) > + { > + static const le_uint32 gdefTableTag = LE_GDEF_TABLE_TAG; > + static const le_uint32 gposTableTag = LE_GPOS_TABLE_TAG; > +- const GlyphPositioningTableHeader *gposTable = > +- (const GlyphPositioningTableHeader *) getFontTable(gposTableTag); > ++ const GlyphPositioningTableHeader *gposTable = (const GlyphPositioningTableHeader *) getFontTable(gposTableTag); > + > + // todo: switch to more flags and bitfield rather than list of feature tags? > + switch (typoFlags) { > +@@ -127,11 +127,10 @@ > + LayoutEngine::reset(); > + } > + > +-OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > +- : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), > +- fFeatureOrder(FALSE), fGSUBTable(NULL), fGDEFTable(NULL), > +- fGPOSTable(NULL), fSubstitutionFilter(NULL) > ++OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags) > ++ : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureOrder(FALSE), > ++ fGSUBTable(NULL), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) > + { > + setScriptAndLanguageTags(); > + } > +@@ -165,9 +164,8 @@ > + fLangSysTag = getLangSysTag(fLanguageCode); > + } > + > +-le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], > +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -178,8 +176,7 @@ > + return 0; > + } > + > +- le_int32 outCharCount = LayoutEngine::characterProcessing(chars, offset, count, > +- max, rightToLeft, outChars, glyphStorage, success); > ++ le_int32 outCharCount = LayoutEngine::characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success); > + > + if (LE_FAILURE(success)) { > + return 0; > +@@ -197,16 +194,14 @@ > + > + // Input: characters, tags > + // Output: glyphs, char indices > +-le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || > +- offset >= max || offset + count > max) { > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > +@@ -218,16 +213,14 @@ > + } > + > + if (fGSUBTable != NULL) { > +- count = fGSUBTable->process(glyphStorage, rightToLeft, > +- fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, > +- fFeatureMap, fFeatureMapCount, fFeatureOrder); > ++ count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, > ++ fFeatureMap, fFeatureMapCount, fFeatureOrder); > + } > + > + return count; > + } > + > +-le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > +@@ -241,9 +234,7 @@ > + return glyphStorage.getGlyphCount(); > + } > + > +-le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, > +- LEErrorCode &success) > ++le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + LEUnicode *outChars = NULL; > + LEGlyphStorage fakeGlyphStorage; > +@@ -253,25 +244,19 @@ > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || > +- offset >= max || offset + count > max) { > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > + > +- outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, > +- outChars, fakeGlyphStorage, success); > ++ outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, fakeGlyphStorage, success); > + > + if (outChars != NULL) { > +- fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, > +- rightToLeft, fakeGlyphStorage, success); > +- // FIXME: a subclass may have allocated this, in which case > +- // this delete might not work... > +- LE_DELETE_ARRAY(outChars); > ++ fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success); > ++ LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... > + //adjustGlyphs(outChars, 0, outCharCount, rightToLeft, fakeGlyphs, fakeGlyphCount); > + } else { > +- fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, > +- fakeGlyphStorage, success); > ++ fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, fakeGlyphStorage, success); > + //adjustGlyphs(chars, offset, count, rightToLeft, fakeGlyphs, fakeGlyphCount); > + } > + > +@@ -281,8 +266,8 @@ > + } > + > + // apply GPOS table, if any > +-void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return; > +@@ -318,8 +303,8 @@ > + } > + #endif > + > +- fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, > +- fGDEFTable, fFontInstance, fFeatureMap, fFeatureMapCount, fFeatureOrder); > ++ fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, fGDEFTable, fFontInstance, > ++ fFeatureMap, fFeatureMapCount, fFeatureOrder); > + > + float xAdjust = 0, yAdjust = 0; > + > +@@ -354,4 +339,12 @@ > + > + delete adjustments; > + } > ++ > ++#if 0 > ++ // Don't know why this is here... > ++ LE_DELETE_ARRAY(fFeatureTags); > ++ fFeatureTags = NULL; > ++#endif > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -23,9 +23,7 @@ > + * > + */ > + > +- > + /* > +- * > + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved > + * > + */ > +@@ -42,6 +40,8 @@ > + #include "GlyphDefinitionTables.h" > + #include "GlyphPositioningTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /** > + * OpenTypeLayoutEngine implements complex text layout for OpenType fonts - that is > + * fonts which have GSUB and GPOS tables associated with them. In order to do this, > +@@ -87,7 +87,7 @@ > + * @internal > + */ > + OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); > + > + /** > + * This constructor is used when the font requires a "canned" GSUB table which can't be known > +@@ -95,11 +95,12 @@ > + * > + * @param fontInstance - the font > + * @param scriptCode - the script > +- * @param languageCode - the language > ++ * @param langaugeCode - the language > + * > + * @internal > + */ > +- OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > ++ OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, > ++ le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -132,6 +133,20 @@ > + */ > + static LETag getLangSysTag(le_int32 languageCode); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + > + /** > +@@ -254,9 +269,8 @@ > + * > + * @internal > + */ > +- virtual le_int32 characterProcessing(const LEUnicode /*chars*/[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool /*rightToLeft*/, > +- LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 characterProcessing(const LEUnicode /*chars*/[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, > ++ LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method does character to glyph mapping, and applies the GSUB table. The > +@@ -287,9 +301,8 @@ > + * > + * @internal > + */ > +- virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method does any processing necessary to convert "fake" > +@@ -316,8 +329,7 @@ > + * > + * @internal > + */ > +- virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method applies the characterProcessing, glyphProcessing and glyphPostProcessing > +@@ -341,8 +353,7 @@ > + * > + * @internal > + */ > +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, > +- le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method uses the GPOS table, if there is one, to adjust the glyph positions. > +@@ -359,8 +370,7 @@ > + * > + * @internal > + */ > +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, > +- le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + /** > + * This method frees the feature tag array so that the > +@@ -372,4 +382,6 @@ > + virtual void reset(); > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,8 +32,15 @@ > + #ifndef __OPENTYPETABLES_H > + #define __OPENTYPETABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define ANY_NUMBER 1 > + > + typedef le_uint16 Offset; > +@@ -62,4 +69,5 @@ > + FeatureMask mask; > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeUtilities.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "OpenTypeUtilities.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // > + // Finds the high bit by binary searching > + // through the bits in n. > +@@ -192,3 +194,7 @@ > + array[i + 1] = v; > + } > + } > ++ > ++ > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeUtilities.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,10 +32,17 @@ > + #ifndef __OPENTYPEUTILITIES_H > + #define __OPENTYPEUTILITIES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > +-class OpenTypeUtilities { > ++U_NAMESPACE_BEGIN > ++ > ++class OpenTypeUtilities /* not : public UObject because all methods are static */ { > + public: > + static le_int8 highBit(le_int32 value); > + static Offset getTagOffset(LETag tag, const TagAndOffsetRecord *records, le_int32 recordCount); > +@@ -48,4 +55,5 @@ > + OpenTypeUtilities() {} // private - forbid instantiation > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/PairPositioningSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,8 @@ > + #include "OpenTypeUtilities.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 PairPositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const > + { > + switch(SWAPW(subtableFormat)) > +@@ -82,8 +84,7 @@ > + const PairValueRecord *pairValueRecord = NULL; > + > + if (pairValueCount != 0) { > +- pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), > +- pairSetTable->pairValueRecordArray, pairValueCount, recordSize); > ++ pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize); > + } > + > + if (pairValueRecord == NULL) { > +@@ -91,8 +92,7 @@ > + } > + > + if (valueFormat1 != 0) { > +- pairValueRecord->valueRecord1.adjustPosition(SWAPW(valueFormat1), (char *) this, > +- tempIterator, fontInstance); > ++ pairValueRecord->valueRecord1.adjustPosition(SWAPW(valueFormat1), (char *) this, tempIterator, fontInstance); > + } > + > + if (valueFormat2 != 0) { > +@@ -171,3 +171,5 @@ > + > + return NULL; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/PairPositioningSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __PAIRPOSITIONINGSUBTABLES_H > + #define __PAIRPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "ValueRecords.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + // NOTE: ValueRecord has a variable size > + struct PairValueRecord > + { > +@@ -96,4 +103,7 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguage.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved > + * > + */ > +@@ -35,6 +36,8 @@ > + #include "ScriptAndLanguage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const LangSysTable *ScriptTable::findLanguage(LETag languageTag, le_bool exactMatch) const > + { > + le_uint16 count = SWAPW(langSysCount); > +@@ -79,3 +82,5 @@ > + > + return scriptTable->findLanguage(languageTag, exactMatch); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguage.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __SCRIPTANDLANGUAGE_H > + #define __SCRIPTANDLANGUAGE_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + typedef TagAndOffsetRecord LangSysRecord; > + > + struct LangSysTable > +@@ -65,4 +72,6 @@ > + const LangSysTable *findLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch = FALSE) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "ScriptAndLanguageTags.h" > + #include "OpenTypeLayoutEngine.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const LETag OpenTypeLayoutEngine::scriptTags[] = { > + zyyyScriptTag, /* 'zyyy' (COMMON) */ > + qaaiScriptTag, /* 'qaai' (INHERITED) */ > +@@ -125,3 +127,5 @@ > + zhsLanguageTag, /* 'ZHS' (Chinese (Simplified)) */ > + zhtLanguageTag /* 'ZHT' (Chinese (Traditional)) */ > + }; > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguageTags.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,13 @@ > + > + #include "LETypes.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + const LETag zyyyScriptTag = 0x7A797979; /* 'zyyy' (COMMON) */ > + const LETag qaaiScriptTag = 0x71616169; /* 'qaai' (INHERITED) */ > + const LETag arabScriptTag = 0x61726162; /* 'arab' (ARABIC) */ > +@@ -126,4 +133,6 @@ > + const LETag zhsLanguageTag = 0x5A485320; /* 'ZHS' (Chinese (Simplified)) */ > + const LETag zhtLanguageTag = 0x5A485420; /* 'ZHT' (Chinese (Traditional)) */ > + > ++ > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentArrayProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SegmentArrayProcessor) > ++ > + SegmentArrayProcessor::SegmentArrayProcessor() > + { > + } > +@@ -77,3 +81,5 @@ > + } > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentArrayProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __SEGMENTARRAYPROCESSOR_H > + #define __SEGMENTARRAYPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + #include "NonContextualGlyphSubstProc.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class SegmentArrayProcessor : public NonContextualGlyphSubstitutionProcessor > +@@ -49,11 +56,28 @@ > + > + virtual ~SegmentArrayProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + SegmentArrayProcessor(); > + > + protected: > + const SegmentArrayLookupTable *segmentArrayLookupTable; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentSingleProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SegmentSingleProcessor) > ++ > + SegmentSingleProcessor::SegmentSingleProcessor() > + { > + } > +@@ -71,3 +75,5 @@ > + } > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentSingleProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __SEGMENTSINGLEPROCESSOR_H > + #define __SEGMENTSINGLEPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + #include "NonContextualGlyphSubstProc.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class SegmentSingleProcessor : public NonContextualGlyphSubstitutionProcessor > +@@ -49,11 +56,28 @@ > + > + virtual ~SegmentSingleProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + SegmentSingleProcessor(); > + > + protected: > + const SegmentSingleLookupTable *segmentSingleLookupTable; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ShapingTypeData.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -36,6 +36,8 @@ > + #include "LETypes.h" > + #include "ArabicShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const le_uint8 ArabicShaping::shapingTypeTable[] = { > + 0x00, 0x02, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0x05, 0x03, 0x00, 0x03, 0x6F, 0x00, 0x05, > + 0x04, 0x83, 0x04, 0x86, 0x00, 0x05, 0x04, 0x88, 0x04, 0x89, 0x00, 0x05, 0x05, 0x91, 0x05, 0xB9, > +@@ -104,3 +106,5 @@ > + 0xFE, 0x20, 0xFE, 0x23, 0x00, 0x05, 0xFE, 0xFF, 0xFE, 0xFF, 0x00, 0x05, 0xFF, 0xF9, 0xFF, 0xFB, > + 0x00, 0x05 > + }; > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SimpleArrayProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleArrayProcessor) > ++ > + SimpleArrayProcessor::SimpleArrayProcessor() > + { > + } > +@@ -68,3 +72,5 @@ > + } > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SimpleArrayProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __SIMPLEARRAYPROCESSOR_H > + #define __SIMPLEARRAYPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + #include "NonContextualGlyphSubstProc.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class SimpleArrayProcessor : public NonContextualGlyphSubstitutionProcessor > +@@ -49,11 +56,28 @@ > + > + virtual ~SimpleArrayProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + SimpleArrayProcessor(); > + > + protected: > + const SimpleArrayLookupTable *simpleArrayLookupTable; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SinglePositioningSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 SinglePositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const > + { > + switch(SWAPW(subtableFormat)) > +@@ -84,11 +86,12 @@ > + le_int16 coverageIndex = (le_int16) getGlyphCoverage(glyph); > + > + if (coverageIndex >= 0) { > +- valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, > +- *glyphIterator, fontInstance); > ++ valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); > + > + return 1; > + } > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SinglePositioningSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __SINGLEPOSITIONINGSUBTABLES_H > + #define __SINGLEPOSITIONINGSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "ValueRecords.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct SinglePositioningSubtable : GlyphPositioningSubtable > + { > + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > +@@ -61,4 +68,7 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + le_uint32 SingleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const > + { > + switch(SWAPW(subtableFormat)) > +@@ -98,3 +100,5 @@ > + > + return 0; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleSubstitutionSubtables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __SINGLESUBSTITUTIONSUBTABLES_H > + #define __SINGLESUBSTITUTIONSUBTABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "OpenTypeTables.h" > + #include "GlyphSubstitutionTables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct SingleSubstitutionSubtable : GlyphSubstitutionSubtable > + { > + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; > +@@ -58,4 +65,7 @@ > + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleTableProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleTableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleTableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SingleTableProcessor) > ++ > + SingleTableProcessor::SingleTableProcessor() > + { > + } > +@@ -68,3 +72,5 @@ > + } > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleTableProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleTableProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleTableProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __SINGLETABLEPROCESSOR_H > + #define __SINGLETABLEPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + #include "NonContextualGlyphSubstProc.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class SingleTableProcessor : public NonContextualGlyphSubstitutionProcessor > +@@ -49,11 +56,27 @@ > + > + virtual ~SingleTableProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + SingleTableProcessor(); > + > + protected: > + const SingleTableLookupTable *singleTableLookupTable; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTableProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,8 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + StateTableProcessor::StateTableProcessor() > + { > + } > +@@ -96,3 +98,5 @@ > + > + endStateTable(); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTableProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTableProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTableProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,18 @@ > + #ifndef __STATETABLEPROCESSOR_H > + #define __STATETABLEPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "MorphStateTables.h" > + #include "SubtableProcessor.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class StateTableProcessor : public SubtableProcessor > +@@ -72,4 +79,5 @@ > + StateTableProcessor &operator=(const StateTableProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTables.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTables.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTables.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,9 +32,16 @@ > + #ifndef __STATETABLES_H > + #define __STATETABLES_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LayoutTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct StateTableHeader > + { > + le_int16 stateSize; > +@@ -78,4 +85,6 @@ > + le_int16 flags; > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubstitutionLookups.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,8 @@ > + #include "CoverageTables.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + /* > + NOTE: This could be optimized somewhat by keeping track > + of the previous sequenceIndex in the loop and doing next() > +@@ -65,3 +67,5 @@ > + lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance); > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubstitutionLookups.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,6 +32,11 @@ > + #ifndef __SUBSTITUTIONLOOKUPS_H > + #define __SUBSTITUTIONLOOKUPS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > +@@ -39,6 +44,8 @@ > + #include "GlyphIterator.h" > + #include "LookupProcessor.h" > + > ++U_NAMESPACE_BEGIN > ++ > + struct SubstitutionLookupRecord > + { > + le_uint16 sequenceIndex; > +@@ -56,4 +63,6 @@ > + le_int32 position); > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubtableProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubtableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SubtableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -34,6 +34,8 @@ > + #include "SubtableProcessor.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + SubtableProcessor::SubtableProcessor() > + { > + } > +@@ -50,3 +52,5 @@ > + SubtableProcessor::~SubtableProcessor() > + { > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubtableProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubtableProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/SubtableProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,13 +32,19 @@ > + #ifndef __SUBTABLEPROCESSOR_H > + #define __SUBTABLEPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > +-class SubtableProcessor > +-{ > ++class SubtableProcessor : public UMemory { > + public: > + virtual void process(LEGlyphStorage &glyphStorage) = 0; > + virtual ~SubtableProcessor(); > +@@ -60,4 +66,6 @@ > + SubtableProcessor &operator=(const SubtableProcessor &other); // forbid copying of this class > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiLayoutEngine.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,8 +38,11 @@ > + > + #include "ThaiShaping.h" > + > +-ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, > +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ThaiLayoutEngine) > ++ > ++ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) > + : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) > + { > + fErrorChar = 0x25CC; > +@@ -73,16 +76,13 @@ > + // Output: glyphs, char indices > + // Returns: the glyph count > + // NOTE: this assumes that ThaiShaping::compose will allocate the outChars array... > +-le_int32 ThaiLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool /*rightToLeft*/, > +- LEGlyphStorage &glyphStorage, LEErrorCode &success) > ++le_int32 ThaiLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) > + { > + if (LE_FAILURE(success)) { > + return 0; > + } > + > +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || > +- offset >= max || offset + count > max) { > ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { > + success = LE_ILLEGAL_ARGUMENT_ERROR; > + return 0; > + } > +@@ -107,8 +107,7 @@ > + return 0; > + } > + > +- glyphCount = ThaiShaping::compose(chars, offset, count, fGlyphSet, fErrorChar, > +- outChars, glyphStorage); > ++ glyphCount = ThaiShaping::compose(chars, offset, count, fGlyphSet, fErrorChar, outChars, glyphStorage); > + mapCharsToGlyphs(outChars, 0, glyphCount, FALSE, FALSE, glyphStorage, success); > + > + LE_DELETE_ARRAY(outChars); > +@@ -116,3 +115,5 @@ > + glyphStorage.adoptGlyphCount(glyphCount); > + return glyphCount; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiLayoutEngine.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -39,6 +39,8 @@ > + > + #include "ThaiShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + /** > +@@ -66,8 +68,7 @@ > + * > + * @internal > + */ > +- ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, > +- le_int32 languageCode, le_int32 typoFlags); > ++ ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); > + > + /** > + * The destructor, virtual for correct polymorphic invocation. > +@@ -76,6 +77,20 @@ > + */ > + virtual ~ThaiLayoutEngine(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + protected: > + /** > + * A small integer indicating which Thai encoding > +@@ -109,10 +124,8 @@ > + * @param offset - the index of the first character to process > + * @param count - the number of characters to process > + * @param max - the number of characters in the input context > +- * @param rightToLeft - TRUE if the text is in a > +- * right to left directional run > +- * @param glyphStorage - the glyph storage object. The glyph and > +- * char index arrays will be set. > ++ * @param rightToLeft - TRUE if the text is in a right to left directional run > ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. > + * > + * Output parameters: > + * @param success - set to an error code if the operation fails > +@@ -123,10 +136,11 @@ > + * > + * @internal > + */ > +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, > +- le_int32 count, le_int32 max, le_bool rightToLeft, > ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, > + LEGlyphStorage &glyphStorage, LEErrorCode &success); > + > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiShaping.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiShaping.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiShaping.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -35,6 +35,8 @@ > + #include "LEGlyphStorage.h" > + #include "ThaiShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + enum { > + CH_SPACE = 0x0020, > + CH_YAMAKKAN = 0x0E4E, > +@@ -248,9 +250,8 @@ > + return transition.nextState; > + } > + > +-le_uint8 ThaiShaping::getNextState(LEUnicode ch, le_uint8 prevState, le_int32 inputIndex, > +- le_uint8 glyphSet, LEUnicode errorChar, > +- le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex) > ++le_uint8 ThaiShaping::getNextState(LEUnicode ch, le_uint8 prevState, le_int32 inputIndex, le_uint8 glyphSet, LEUnicode errorChar, > ++ le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex) > + { > + StateTransition transition; > + > +@@ -327,3 +328,5 @@ > + > + return outputIndex; > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiShaping.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiShaping.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiShaping.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,13 +32,20 @@ > + #ifndef __THAISHAPING_H > + #define __THAISHAPING_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEGlyphFilter.h" > + #include "OpenTypeTables.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > +-class ThaiShaping { > ++class ThaiShaping /* not : public UObject because all methods are static */ { > + public: > + > + enum { > +@@ -120,4 +127,7 @@ > + return thaiStateTable[state][currClass]; > + } > + > ++U_NAMESPACE_END > + #endif > ++ > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiStateTables.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiStateTables.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiStateTables.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -25,6 +25,7 @@ > + > + /* > + * > ++ * > + * (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved > + * > + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS > +@@ -35,6 +36,8 @@ > + #include "LETypes.h" > + #include "ThaiShaping.h" > + > ++U_NAMESPACE_BEGIN > ++ > + const le_uint8 ThaiShaping::classTable[] = { > + // 0 1 2 3 4 5 6 7 8 9 A B C D E F > + // ------------------------------------------------------------------------------- > +@@ -105,3 +108,5 @@ > + /*50*/ {{ 0, tA}, { 1, tA}, {18, tA}, {35, tA}, { 0, tA}, { 0, tS}, { 0, tS}, { 0, tA}, { 0, tR}, { 0, tR}, { 0, tR}, {51, tC}, { 0, tR}, { 0, tC}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}}, > + /*51*/ {{ 0, tA}, { 1, tA}, {18, tA}, {35, tA}, { 0, tA}, { 0, tS}, { 0, tA}, { 0, tA}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}} > + }; > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -38,6 +38,10 @@ > + #include "LEGlyphStorage.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TrimmedArrayProcessor) > ++ > + TrimmedArrayProcessor::TrimmedArrayProcessor() > + { > + } > +@@ -72,3 +76,5 @@ > + } > + } > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/TrimmedArrayProcessor.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,12 +32,19 @@ > + #ifndef __TRIMMEDARRAYPROCESSOR_H > + #define __TRIMMEDARRAYPROCESSOR_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "MorphTables.h" > + #include "SubtableProcessor.h" > + #include "NonContextualGlyphSubst.h" > + #include "NonContextualGlyphSubstProc.h" > + > ++U_NAMESPACE_BEGIN > ++ > + class LEGlyphStorage; > + > + class TrimmedArrayProcessor : public NonContextualGlyphSubstitutionProcessor > +@@ -49,6 +56,20 @@ > + > + virtual ~TrimmedArrayProcessor(); > + > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ virtual UClassID getDynamicClassID() const; > ++ > ++ /** > ++ * ICU "poor man's RTTI", returns a UClassID for this class. > ++ * > ++ * @stable ICU 2.8 > ++ */ > ++ static UClassID getStaticClassID(); > ++ > + private: > + TrimmedArrayProcessor(); > + > +@@ -56,6 +77,9 @@ > + TTGlyphID firstGlyph; > + TTGlyphID lastGlyph; > + const TrimmedArrayLookupTable *trimmedArrayLookupTable; > ++ > + }; > + > ++U_NAMESPACE_END > + #endif > ++ > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ValueRecords.cpp > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ValueRecords.cpp Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ValueRecords.cpp Tue Sep 29 14:06:13 2009 -0700 > +@@ -37,6 +37,8 @@ > + #include "GlyphIterator.h" > + #include "LESwaps.h" > + > ++U_NAMESPACE_BEGIN > ++ > + #define Nibble(value, nibble) ((value >> (nibble * 4)) & 0xF) > + #define NibbleBits(value, nibble) (bitsInNibble[Nibble(value, nibble)]) > + > +@@ -161,8 +163,8 @@ > + xPlacementAdjustment, yPlacementAdjustment, xAdvanceAdjustment, yAdvanceAdjustment); > + } > + > +-void ValueRecord::adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, > +- GlyphIterator &glyphIterator, const LEFontInstance *fontInstance) const > ++void ValueRecord::adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator, > ++ const LEFontInstance *fontInstance) const > + { > + float xPlacementAdjustment = 0; > + float yPlacementAdjustment = 0; > +@@ -323,3 +325,5 @@ > + > + return getFieldCount(valueFormat & beforeMasks[field]); > + } > ++ > ++U_NAMESPACE_END > +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ValueRecords.h > +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ValueRecords.h Mon Sep 28 11:52:22 2009 -0700 > ++++ openjdk/jdk/src/share/native/sun/font/layout/ValueRecords.h Tue Sep 29 14:06:13 2009 -0700 > +@@ -32,11 +32,18 @@ > + #ifndef __VALUERECORDS_H > + #define __VALUERECORDS_H > + > ++/** > ++ * \file > ++ * \internal > ++ */ > ++ > + #include "LETypes.h" > + #include "LEFontInstance.h" > + #include "OpenTypeTables.h" > + #include "GlyphIterator.h" > + > ++U_NAMESPACE_BEGIN > ++ > + typedef le_uint16 ValueFormat; > + typedef le_int16 ValueRecordField; > + > +@@ -84,5 +91,7 @@ > + vfbAnyDevice = vfbXPlaDevice + vfbYPlaDevice + vfbXAdvDevice + vfbYAdvDevice > + }; > + > ++U_NAMESPACE_END > ++#endif > + > +-#endif > ++ -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/bd3f814a/attachment.bin From ptisnovs at redhat.com Fri Jun 1 05:29:38 2012 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Fri, 01 Jun 2012 14:29:38 +0200 Subject: Reviewer needed: small patch for a LETypes.h + "6501644: sync LayoutEngine *code* structure to match ICU" for IcedTea6 HEAD In-Reply-To: <20120601113125.GA10601@rivendell.middle-earth.co.uk> References: <4FC78EA6.6070709@redhat.com> <20120601113125.GA10601@rivendell.middle-earth.co.uk> Message-ID: <4FC8B5B2.1060309@redhat.com> Dr Andrew John Hughes wrote: > On 17:30 Thu 31 May , Pavel Tisnovsky wrote: >> Hi, >> >> to be able to backport "6886358: layout code update" (== fix for PR1018) into >> IcedTea6 HEAD it is needed to synchronize OpenJDK6 sources with OpenJDK7. >> >> To do that the "6501644: sync LayoutEngine *code* structure to match ICU" should >> be backported to IcedTea6 HEAD + I added a small patch for a header file >> LETypes.h to allow the patch to be applied cleanly. >> >> Can anybody please review this small fix + backport of "6501644: sync LayoutEngine *code* structure to match ICU" >> into IcedTea6 HEAD? It's been tested w/o problems ATM. >> >> ChangeLog entry: >> >> 2012-05-31 Pavel Tisnovsky >> >> * patches/letypes-header.patch: >> Fix for the header file LETypes.h to allow the following patch >> to be applied cleanly. >> * patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch: >> 6501644: sync LayoutEngine *code* structure to match ICU >> * Makefile.am: Updated. >> >> >> >> Cheers, >> Pavel > > Where does the LETypes.h patch come from and why is it needed? Does 7 not need it too? Hi Andrew, it's a small part of this change which we are AFAIK not allowed to backport to OpenJDK6/IcedTea6: 6850113: Bidi class needs to be updated to support Unicode 5.1 Reviewed-by: okutsu Pavel > >> diff -r aaefc2cbbc10 Makefile.am >> --- a/Makefile.am Wed May 16 12:59:46 2012 +0100 >> +++ b/Makefile.am Thu May 31 17:27:49 2012 +0200 >> @@ -417,7 +417,9 @@ >> patches/openjdk/p11cipher-6867345-turkish_regional_options_cause_npe_in_algoid.patch \ >> patches/openjdk/p11cipher-6687725-throw_illegalblocksizeexception.patch \ >> patches/openjdk/p11cipher-6924489-ckr_operation_not_initialized.patch \ >> - patches/openjdk/p11cipher-6604496-support_ckm_aes_ctr.patch >> + patches/openjdk/p11cipher-6604496-support_ckm_aes_ctr.patch \ >> + patches/letypes-header.patch \ >> + patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch >> >> if WITH_RHINO >> ICEDTEA_PATCHES += \ >> diff -r aaefc2cbbc10 patches/letypes-header.patch >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/patches/letypes-header.patch Thu May 31 17:27:49 2012 +0200 >> @@ -0,0 +1,13 @@ >> +diff -r 019908df0313 -r 1bbbd0ef5d04 src/share/native/sun/font/layout/LETypes.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LETypes.h Thu May 28 18:11:07 2009 +0400 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LETypes.h Sat Jun 13 06:43:54 2009 +0900 >> +@@ -36,7 +36,8 @@ >> + #define LE_USE_CMEMORY >> + >> + #ifdef LE_USE_CMEMORY >> +-#include "cmemory.h" >> ++#include >> ++#include >> + #endif >> + >> + #ifndef _LP64 >> diff -r aaefc2cbbc10 patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch >> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> +++ b/patches/openjdk/6501644-sync-LayoutEngine-code-to-match-ICU.patch Thu May 31 17:27:49 2012 +0200 >> @@ -0,0 +1,8062 @@ >> +# HG changeset patch >> +# User srl >> +# Date 1254258373 25200 >> +# Node ID c74d38ef118c45d1d5a077e1917243d52829a8e4 >> +# Parent 27d58a02bb9de7f8a7aab869079f7cd4ef3b5214 >> +6501644: sync LayoutEngine *code* structure to match ICU >> +Reviewed-by: prr >> + >> +diff -r 27d58a02bb9d -r c74d38ef118c make/sun/font/Makefile >> +--- openjdk.orig/jdk/make/sun/font/Makefile Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/make/sun/font/Makefile Tue Sep 29 14:06:13 2009 -0700 >> +@@ -199,3 +199,7 @@ >> + CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows >> + endif >> + >> ++# Make the Layout Engine build standalone >> ++CPPFLAGS += -DLE_STANDALONE >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AlternateSubstSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 AlternateSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const >> + { >> + // NOTE: For now, we'll just pick the first alternative... >> +@@ -64,3 +66,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AlternateSubstSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/AlternateSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __ALTERNATESUBSTITUTIONSUBTABLES_H >> + #define __ALTERNATESUBSTITUTIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphSubstitutionTables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct AlternateSetTable >> + { >> + le_uint16 glyphCount; >> +@@ -52,4 +59,5 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AnchorTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AnchorTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/AnchorTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "AnchorTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + void AnchorTable::getAnchor(LEGlyphID glyphID, const LEFontInstance *fontInstance, >> + LEPoint &anchor) const >> + { >> +@@ -124,3 +126,6 @@ >> + >> + fontInstance->pixelsToUnits(pixels, anchor); >> + } >> ++ >> ++U_NAMESPACE_END >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AnchorTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AnchorTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/AnchorTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,10 +32,17 @@ >> + #ifndef __ANCHORTABLES_H >> + #define __ANCHORTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct AnchorTable >> + { >> + le_uint16 anchorFormat; >> +@@ -66,5 +73,7 @@ >> + void getAnchor(const LEFontInstance *fontInstance, LEPoint &anchor) const; >> + }; >> + >> ++U_NAMESPACE_END >> ++#endif >> + >> +-#endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -49,23 +49,25 @@ >> + #include "ArabicShaping.h" >> + #include "CanonShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_bool CharSubstitutionFilter::accept(LEGlyphID glyph) const >> + { >> + return fFontInstance->canDisplay((LEUnicode) glyph); >> + } >> + >> +-ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine( >> +- const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ArabicOpenTypeLayoutEngine) >> ++ >> ++ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) >> + { >> + fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); >> + fFeatureOrder = TRUE; >> + } >> + >> +-ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine( >> +- const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags) >> + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) >> + { >> + fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount); >> +@@ -86,9 +88,8 @@ >> + // Input: characters >> + // Output: characters, char indices, tags >> + // Returns: output character count >> +-le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -124,8 +125,8 @@ >> + return count; >> + } >> + >> +-void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -137,24 +138,20 @@ >> + } >> + >> + if (fGPOSTable != NULL) { >> +- OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count, >> +- reverse, glyphStorage, success); >> ++ OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success); >> + } else if (fGDEFTable != NULL) { >> + GDEFMarkFilter filter(fGDEFTable); >> + >> + adjustMarkGlyphs(glyphStorage, &filter, success); >> + } else { >> +- GlyphDefinitionTableHeader *gdefTable = >> +- (GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable; >> ++ GlyphDefinitionTableHeader *gdefTable = (GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable; >> + GDEFMarkFilter filter(gdefTable); >> + >> + adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success); >> + } >> + } >> + >> +-UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine( >> +- const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> + : ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) >> + { >> + fGSUBTable = (const GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; >> +@@ -169,8 +166,7 @@ >> + } >> + >> + // "glyphs", "indices" -> glyphs, indices >> +-le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing( >> +- LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -193,17 +189,14 @@ >> + >> + glyphStorage.adoptCharIndicesArray(tempGlyphStorage); >> + >> +- ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE, >> +- TRUE, glyphStorage, success); >> ++ ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE, TRUE, glyphStorage, success); >> + >> + LE_DELETE_ARRAY(tempChars); >> + >> + return tempGlyphCount; >> + } >> + >> +-void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -228,9 +221,8 @@ >> + } >> + } >> + >> +-void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_bool reverse, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -245,3 +237,6 @@ >> + >> + adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success); >> + } >> ++ >> ++U_NAMESPACE_END >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -43,6 +43,8 @@ >> + #include "GlyphDefinitionTables.h" >> + #include "GlyphPositioningTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /** >> + * This class implements OpenType layout for Arabic fonts. It overrides >> + * the characerProcessing method to assign the correct OpenType feature >> +@@ -71,8 +73,8 @@ >> + * >> + * @internal >> + */ >> +- ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> ++ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> + >> + /** >> + * This constructor is used when the font requires a "canned" GSUB table which can't be known >> +@@ -87,8 +89,8 @@ >> + * >> + * @internal >> + */ >> +- ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, le_int32 typoFlags); >> ++ ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -97,6 +99,20 @@ >> + */ >> + virtual ~ArabicOpenTypeLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + >> + /** >> +@@ -108,8 +124,7 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in a >> +- * right to left directional run >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> + * >> + * Output parameters: >> + * @param outChars - the output character arrayt >> +@@ -121,9 +136,8 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method applies the GPOS table if it is present, otherwise it ensures that all vowel >> +@@ -142,11 +156,9 @@ >> + * >> + * @internal >> + */ >> +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> +- // static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, >> +- // le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ // static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + }; >> + >> +@@ -178,8 +190,8 @@ >> + * >> + * @internal >> + */ >> +- UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> ++ UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -208,8 +220,7 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method copies the input characters into the output glyph index array, >> +@@ -227,8 +238,7 @@ >> + * >> + * @internal >> + */ >> +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, le_bool mirror, >> ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, >> + LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +@@ -245,8 +255,9 @@ >> + * >> + * @internal >> + */ >> +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicShaping.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicShaping.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "ClassDefinitionTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // This table maps Unicode joining types to >> + // ShapeTypes. >> + const ArabicShaping::ShapeType ArabicShaping::shapeTypes[] = >> +@@ -102,9 +104,7 @@ >> + #define markFeatureMask 0x00040000UL >> + #define mkmkFeatureMask 0x00020000UL >> + >> +-#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | \ >> +- markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | \ >> +- dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask) >> ++#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask) >> + >> + #define SHAPE_MASK 0xF0000000UL >> + >> +@@ -226,3 +226,5 @@ >> + adjustTags(erout, 2, glyphStorage); >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ArabicShaping.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ArabicShaping.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ArabicShaping.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __ARABICSHAPING_H >> + #define __ARABICSHAPING_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> +-class ArabicShaping { >> ++class ArabicShaping /* not : public UObject because all methods are static */ { >> + public: >> + // Joining types >> + enum JoiningTypes >> +@@ -74,8 +81,8 @@ >> + >> + typedef le_int32 ShapeType; >> + >> +- static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, >> +- le_int32 charMax, le_bool rightToLeft, LEGlyphStorage &glyphStorage); >> ++ static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax, >> ++ le_bool rightToLeft, LEGlyphStorage &glyphStorage); >> + >> + static const FeatureMap *getFeatureMap(le_int32 &count); >> + >> +@@ -88,8 +95,8 @@ >> + static const le_uint8 shapingTypeTable[]; >> + static const ShapeType shapeTypes[]; >> + >> +- static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, >> +- LEGlyphStorage &glyphStorage); >> ++ static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage); >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/AttachmentPosnSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/AttachmentPosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/AttachmentPosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __ATTACHMENTPOSITIONINGSUBTABLES_H >> + #define __ATTACHMENTPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphPositioningTables.h" >> + #include "ValueRecords.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct AttachmentPositioningSubtable : GlyphPositioningSubtable >> + { >> + Offset baseCoverageTableOffset; >> +@@ -55,4 +62,6 @@ >> + return getGlyphCoverage(baseCoverageTableOffset, baseGlyphID); >> + } >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonData.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonData.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonData.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,8 @@ >> + #include "LETypes.h" >> + #include "CanonShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const le_uint8 CanonShaping::glyphSubstitutionTable[] = { >> + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x58, 0x02, 0x86, 0x00, 0x12, 0x61, 0x72, 0x61, 0x62, >> + 0x00, 0x6E, 0x62, 0x65, 0x6E, 0x67, 0x00, 0x82, 0x63, 0x79, 0x72, 0x6C, 0x00, 0x8E, 0x64, 0x65, >> +@@ -3773,3 +3775,5 @@ >> + 0x00, 0xDC, 0xD1, 0x85, 0xD1, 0x89, 0x00, 0xE6, 0xD1, 0x8A, 0xD1, 0x8B, 0x00, 0xDC, 0xD1, 0xAA, >> + 0xD1, 0xAD, 0x00, 0xE6, 0xD2, 0x42, 0xD2, 0x44, 0x00, 0xE6 >> + }; >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonShaping.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonShaping.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonShaping.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,8 +35,9 @@ >> + #include "GlyphDefinitionTables.h" >> + #include "ClassDefinitionTables.h" >> + >> +-void CanonShaping::sortMarks(le_int32 *indices, >> +- const le_int32 *combiningClasses, le_int32 index, le_int32 limit) >> ++U_NAMESPACE_BEGIN >> ++ >> ++void CanonShaping::sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit) >> + { >> + for (le_int32 j = index + 1; j < limit; j += 1) { >> + le_int32 i; >> +@@ -55,13 +56,11 @@ >> + } >> + } >> + >> +-void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, >> +- le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage) >> ++void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft, >> ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage) >> + { >> +- const GlyphDefinitionTableHeader *gdefTable = >> +- (const GlyphDefinitionTableHeader *) glyphDefinitionTable; >> +- const ClassDefinitionTable *classTable = >> +- gdefTable->getMarkAttachClassDefinitionTable(); >> ++ const GlyphDefinitionTableHeader *gdefTable = (const GlyphDefinitionTableHeader *) glyphDefinitionTable; >> ++ const ClassDefinitionTable *classTable = gdefTable->getMarkAttachClassDefinitionTable(); >> + le_int32 *combiningClasses = LE_NEW_ARRAY(le_int32, charCount); >> + le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount); >> + LEErrorCode status = LE_NO_ERROR; >> +@@ -103,3 +102,5 @@ >> + LE_DELETE_ARRAY(indices); >> + LE_DELETE_ARRAY(combiningClasses); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CanonShaping.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CanonShaping.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CanonShaping.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,20 +34,22 @@ >> + >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> +-class CanonShaping >> ++class CanonShaping /* not : public UObject because all members are static */ >> + { >> + public: >> + static const le_uint8 glyphSubstitutionTable[]; >> + static const le_uint8 glyphDefinitionTable[]; >> + >> +- static void reorderMarks(const LEUnicode *inChars, le_int32 charCount, >> +- le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage); >> ++ static void reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft, >> ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage); >> + >> + private: >> +- static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses, >> +- le_int32 index, le_int32 limit); >> ++ static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit); >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CharSubstitutionFilter.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CharSubstitutionFilter.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CharSubstitutionFilter.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEFontInstance; >> + >> + /** >> +@@ -43,7 +45,7 @@ >> + * >> + * @internal >> + */ >> +-class CharSubstitutionFilter : public LEGlyphFilter >> ++class CharSubstitutionFilter : public UMemory, public LEGlyphFilter >> + { >> + private: >> + /** >> +@@ -98,4 +100,7 @@ >> + le_bool accept(LEGlyphID glyph) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ClassDefinitionTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "ClassDefinitionTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_int32 ClassDefinitionTable::getGlyphClass(LEGlyphID glyphID) const >> + { >> + switch(SWAPW(classFormat)) { >> +@@ -139,3 +141,5 @@ >> + >> + return FALSE; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ClassDefinitionTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ClassDefinitionTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __CLASSDEFINITIONTABLES_H >> + #define __CLASSDEFINITIONTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct ClassDefinitionTable >> + { >> + le_uint16 classFormat; >> +@@ -69,4 +76,5 @@ >> + le_bool hasGlyphClass(le_int32 glyphClass) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphInsertion.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphInsertion.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphInsertion.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __CONTEXTUALGLYPHINSERTION_H >> + #define __CONTEXTUALGLYPHINSERTION_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "StateTables.h" >> + #include "MorphTables.h" >> + #include "MorphStateTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct ContextualGlyphInsertionHeader : MorphStateTableHeader >> + { >> + }; >> +@@ -60,4 +67,5 @@ >> + ByteOffset markedInsertionListOffset; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ContextualGlyphSubstitutionProcessor) >> ++ >> + ContextualGlyphSubstitutionProcessor::ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader) >> + : StateTableProcessor(morphSubtableHeader) >> + { >> +@@ -57,8 +61,7 @@ >> + markGlyph = 0; >> + } >> + >> +-ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, >> +- le_int32 &currGlyph, EntryTableIndex index) >> ++ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) >> + { >> + const ContextualGlyphSubstitutionStateEntry *entry = &entryTable[index]; >> + ByteOffset newState = SWAPW(entry->newStateOffset); >> +@@ -97,3 +100,5 @@ >> + void ContextualGlyphSubstitutionProcessor::endStateTable() >> + { >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstProc.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstProc.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H >> + #define __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "StateTableProcessor.h" >> + #include "ContextualGlyphSubstitution.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class ContextualGlyphSubstitutionProcessor : public StateTableProcessor >> +@@ -52,6 +59,20 @@ >> + ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader); >> + virtual ~ContextualGlyphSubstitutionProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + ContextualGlyphSubstitutionProcessor(); >> + >> +@@ -62,6 +83,8 @@ >> + le_int32 markGlyph; >> + >> + const ContextualGlyphSubstitutionHeader *contextualGlyphSubstitutionHeader; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualGlyphSubstitution.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstitution.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualGlyphSubstitution.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,18 @@ >> + #ifndef __CONTEXTUALGLYPHSUBSTITUTION_H >> + #define __CONTEXTUALGLYPHSUBSTITUTION_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "StateTables.h" >> + #include "MorphTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct ContextualGlyphSubstitutionHeader : MorphStateTableHeader >> + { >> + ByteOffset substitutionTableOffset; >> +@@ -55,4 +62,5 @@ >> + WordOffset currOffset; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualSubstSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -39,6 +38,8 @@ >> + #include "CoverageTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /* >> + NOTE: This could be optimized somewhat by keeping track >> + of the previous sequenceIndex in the loop and doing next() >> +@@ -350,7 +351,7 @@ >> + >> + // NOTE: This could be a #define, but that seems to confuse >> + // the Visual Studio .NET 2003 compiler on the calls to the >> +-// GlyphIterator constructor. It somehow can't decide if >> ++// GlyphIterator constructor. It somehow can't decide if >> + // emptyFeatureList matches an le_uint32 or an le_uint16... >> + static const FeatureMask emptyFeatureList = 0x00000000UL; >> + >> +@@ -542,3 +543,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ContextualSubstSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __CONTEXTUALSUBSTITUTIONSUBTABLES_H >> + #define __CONTEXTUALSUBSTITUTIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "GlyphIterator.h" >> + #include "LookupProcessor.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct SubstitutionLookupRecord >> + { >> + le_uint16 sequenceIndex; >> +@@ -218,4 +225,5 @@ >> + le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CoverageTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CoverageTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CoverageTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "CoverageTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_int32 CoverageTable::getGlyphCoverage(LEGlyphID glyphID) const >> + { >> + switch(SWAPW(coverageFormat)) >> +@@ -106,3 +108,5 @@ >> + >> + return startCoverageIndex + (ttGlyphID - firstInRange); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CoverageTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CoverageTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CoverageTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __COVERAGETABLES_H >> + #define __COVERAGETABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct CoverageTable >> + { >> + le_uint16 coverageFormat; >> +@@ -58,5 +65,5 @@ >> + le_int32 getGlyphCoverage(LEGlyphID glyphID) const; >> + }; >> + >> +- >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,8 @@ >> + #include "OpenTypeUtilities.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const >> + { >> + LEGlyphID glyphID = glyphIterator->getCurrGlyphID(); >> +@@ -68,3 +70,5 @@ >> + >> + return 1; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/CursiveAttachmentSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,10 +32,17 @@ >> + #ifndef __CURSIVEATTACHMENTSUBTABLES_H >> + #define __CURSIVEATTACHMENTSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphPositioningTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEFontInstance; >> + class GlyphIterator; >> + >> +@@ -53,4 +60,7 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DefaultCharMapper.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DefaultCharMapper.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/DefaultCharMapper.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,9 +31,16 @@ >> + #ifndef __DEFAULTCHARMAPPER_H >> + #define __DEFAULTCHARMAPPER_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /** >> + * This class is an instance of LECharMapper which >> + * implements control character filtering and bidi >> +@@ -42,7 +48,7 @@ >> + * >> + * @see LECharMapper >> + */ >> +-class DefaultCharMapper : public LECharMapper >> ++class DefaultCharMapper : public UMemory, public LECharMapper >> + { >> + private: >> + le_bool fFilterControls; >> +@@ -77,4 +83,5 @@ >> + LEUnicode32 mapChar(LEUnicode32 ch) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DeviceTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DeviceTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/DeviceTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved >> + * >> + */ >> +@@ -34,6 +35,8 @@ >> + #include "DeviceTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const le_uint16 DeviceTable::fieldMasks[] = {0x0003, 0x000F, 0x00FF}; >> + const le_uint16 DeviceTable::fieldSignBits[] = {0x0002, 0x0008, 0x0080}; >> + const le_uint16 DeviceTable::fieldBits[] = { 2, 4, 8}; >> +@@ -62,3 +65,5 @@ >> + >> + return result; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/DeviceTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/DeviceTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/DeviceTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,10 +33,15 @@ >> + #ifndef __DEVICETABLES_H >> + #define __DEVICETABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> +-#include "GlyphIterator.h" >> +-#include "GlyphPositionAdjustments.h" >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + struct DeviceTable >> + { >> +@@ -52,5 +58,7 @@ >> + static const le_uint16 fieldBits[]; >> + }; >> + >> ++U_NAMESPACE_END >> ++#endif >> + >> +-#endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ExtensionSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,7 +25,8 @@ >> + >> + /* >> + * >> +- * (C) Copyright IBM Corp. 2003 - All Rights Reserved >> ++ * >> ++ * (C) Copyright IBM Corp. 2002 - All Rights Reserved >> + * >> + */ >> + >> +@@ -37,6 +38,9 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++ >> + // FIXME: should look at the format too... maybe have a sub-class for it? >> + le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, >> + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const >> +@@ -52,3 +56,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ExtensionSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 2002-2003 - All Rights Reserved >> + * >> + */ >> +@@ -32,12 +33,19 @@ >> + #ifndef __EXTENSIONSUBTABLES_H >> + #define __EXTENSIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphSubstitutionTables.h" >> + #include "LookupProcessor.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct ExtensionSubtable //: GlyphSubstitutionSubtable >> + { >> + le_uint16 substFormat; >> +@@ -48,4 +56,5 @@ >> + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Features.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Features.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/Features.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved >> + * >> + */ >> +@@ -35,6 +36,8 @@ >> + #include "Features.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const FeatureTable *FeatureListTable::getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const >> + { >> + if (featureIndex >= SWAPW(featureCount)) { >> +@@ -79,3 +82,5 @@ >> + return 0; >> + #endif >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Features.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Features.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/Features.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __FEATURES_H >> + #define __FEATURES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct FeatureRecord >> + { >> + ATag featureTag; >> +@@ -53,9 +60,10 @@ >> + le_uint16 featureCount; >> + FeatureRecord featureRecordArray[ANY_NUMBER]; >> + >> +- const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; >> ++ const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; >> + >> + const FeatureTable *getFeatureTable(LETag featureTag) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GDEFMarkFilter.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "GDEFMarkFilter.h" >> + #include "GlyphDefinitionTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + GDEFMarkFilter::GDEFMarkFilter(const GlyphDefinitionTableHeader *gdefTable) >> + { >> + classDefTable = gdefTable->getGlyphClassDefinitionTable(); >> +@@ -50,3 +52,5 @@ >> + >> + return glyphClass == gcdMarkGlyph; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GDEFMarkFilter.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GDEFMarkFilter.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,18 @@ >> + #ifndef __GDEFMARKFILTER__H >> + #define __GDEFMARKFILTER__H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "GlyphDefinitionTables.h" >> + >> +-class GDEFMarkFilter : public LEGlyphFilter >> ++U_NAMESPACE_BEGIN >> ++ >> ++class GDEFMarkFilter : public UMemory, public LEGlyphFilter >> + { >> + private: >> + const GlyphClassDefinitionTable *classDefTable; >> +@@ -51,5 +58,5 @@ >> + virtual le_bool accept(LEGlyphID glyph) const; >> + }; >> + >> +- >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GXLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GXLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,6 +23,7 @@ >> + * >> + */ >> + >> ++ >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> +@@ -36,8 +37,11 @@ >> + >> + #include "MorphTables.h" >> + >> +-GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, const MorphTableHeader *morphTable) >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine) >> ++ >> ++GXLayoutEngine::GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable) >> + : LayoutEngine(fontInstance, scriptCode, languageCode, 0), fMorphTable(morphTable) >> + { >> + // nothing else to do? >> +@@ -49,9 +53,7 @@ >> + } >> + >> + // apply 'mort' table >> +-le_int32 GXLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, >> +- LEErrorCode &success) >> ++le_int32 GXLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -74,9 +76,8 @@ >> + } >> + >> + // apply positional tables >> +-void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_bool /*reverse*/, >> +- LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success) >> ++void GXLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool /*reverse*/, >> ++ LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -89,3 +90,5 @@ >> + >> + // FIXME: no positional processing yet... >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GXLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,6 +23,7 @@ >> + * >> + */ >> + >> ++ >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved >> +@@ -37,6 +38,8 @@ >> + >> + #include "MorphTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEFontInstance; >> + class LEGlyphStorage; >> + >> +@@ -70,8 +73,7 @@ >> + * >> + * @internal >> + */ >> +- GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, const MorphTableHeader *morphTable); >> ++ GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const MorphTableHeader *morphTable); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -80,6 +82,20 @@ >> + */ >> + virtual ~GXLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + >> + /** >> +@@ -99,10 +115,8 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the text is in a >> +- * right to left directional run >> +- * @param glyphStorage - the glyph storage object. The glyph >> +- * and char index arrays will be set. >> ++ * @param rightToLeft - TRUE if the text is in a right to left directional run >> ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -111,8 +125,7 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> + LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +@@ -120,16 +133,18 @@ >> + * 'kern', 'trak', 'bsln', 'opbd' and 'just' tables. >> + * >> + * Input parameters: >> +- * @param glyphStorage - the object holding the glyph storage. >> +- * The positions will be updated as needed. >> ++ * @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> + * >> + * @internal >> + */ >> +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphDefinitionTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "GlyphDefinitionTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const GlyphClassDefinitionTable *GlyphDefinitionTableHeader::getGlyphClassDefinitionTable() const >> + { >> + return (const GlyphClassDefinitionTable *) ((char *) this + SWAPW(glyphClassDefOffset)); >> +@@ -53,3 +55,5 @@ >> + { >> + return (const MarkAttachClassDefinitionTable *) ((char *) this + SWAPW(MarkAttachClassDefOffset)); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphDefinitionTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphDefinitionTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,10 +32,17 @@ >> + #ifndef __GLYPHDEFINITIONTABLES_H >> + #define __GLYPHDEFINITIONTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "ClassDefinitionTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + typedef ClassDefinitionTable GlyphClassDefinitionTable; >> + >> + enum GlyphClassDefinitions >> +@@ -110,4 +117,5 @@ >> + const MarkAttachClassDefinitionTable *getMarkAttachClassDefinitionTable() const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphIterator.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,11 +38,10 @@ >> + #include "Lookups.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> + >> +-GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, >> +- GlyphPositionAdjustments *theGlyphPositionAdjustments, >> +- le_bool rightToLeft, le_uint16 theLookupFlags, FeatureMask theFeatureMask, >> +- const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader) >> ++GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, >> ++ FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader) >> + : direction(1), position(-1), nextLimit(-1), prevLimit(-1), >> + glyphStorage(theGlyphStorage), glyphPositionAdjustments(theGlyphPositionAdjustments), >> + srcIndex(-1), destIndex(-1), lookupFlags(theLookupFlags), featureMask(theFeatureMask), >> +@@ -262,8 +261,8 @@ >> + glyphPositionAdjustments->setBaseOffset(position, baseOffset); >> + } >> + >> +-void GlyphIterator::adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, >> +- float yPlacementAdjust, float xAdvanceAdjust, float yAdvanceAdjust) >> ++void GlyphIterator::adjustCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust, >> ++ float xAdvanceAdjust, float yAdvanceAdjust) >> + { >> + if (direction < 0) { >> + if (position <= nextLimit || position >= prevLimit) { >> +@@ -281,8 +280,8 @@ >> + glyphPositionAdjustments->adjustYAdvance(position, yAdvanceAdjust); >> + } >> + >> +-void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, >> +- float yPlacementAdjust, float xAdvanceAdjust, float yAdvanceAdjust) >> ++void GlyphIterator::setCurrGlyphPositionAdjustment(float xPlacementAdjust, float yPlacementAdjust, >> ++ float xAdvanceAdjust, float yAdvanceAdjust) >> + { >> + if (direction < 0) { >> + if (position <= nextLimit || position >= prevLimit) { >> +@@ -484,10 +483,11 @@ >> + >> + do { >> + newPosition -= direction; >> +- } while (newPosition != prevLimit && glyphStorage[newPosition] != 0xFFFE && >> +- filterGlyph(newPosition)); >> ++ } while (newPosition != prevLimit && glyphStorage[newPosition] != 0xFFFE && filterGlyph(newPosition)); >> + >> + position = newPosition; >> + >> + return position != prevLimit; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphIterator.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphIterator.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphIterator.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,26 +32,24 @@ >> + #ifndef __GLYPHITERATOR_H >> + #define __GLYPHITERATOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphDefinitionTables.h" >> + >> +-struct InsertionRecord >> +-{ >> +- InsertionRecord *next; >> +- le_int32 position; >> +- le_int32 count; >> +- LEGlyphID glyphs[ANY_NUMBER]; >> +-}; >> ++U_NAMESPACE_BEGIN >> + >> + class LEGlyphStorage; >> + class GlyphPositionAdjustments; >> + >> +-class GlyphIterator { >> ++class GlyphIterator : public UMemory { >> + public: >> +- GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, >> +- le_bool rightToLeft, le_uint16 theLookupFlags, FeatureMask theFeatureMask, >> +- const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader); >> ++ GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjustments *theGlyphPositionAdjustments, le_bool rightToLeft, le_uint16 theLookupFlags, >> ++ FeatureMask theFeatureMask, const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader); >> + >> + GlyphIterator(GlyphIterator &that); >> + >> +@@ -122,4 +120,5 @@ >> + GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphLookupTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphLookupTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphLookupTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "GlyphLookupTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_bool GlyphLookupTableHeader::coversScript(LETag scriptTag) const >> + { >> + const ScriptListTable *scriptListTable = (const ScriptListTable *) ((char *)this + SWAPW(scriptListOffset)); >> +@@ -51,3 +53,5 @@ >> + // Note: don't have to SWAPW langSysTable->featureCount to check for non-zero. >> + return langSysTable != NULL && langSysTable->featureCount != 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphLookupTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphLookupTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphLookupTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __GLYPHLOOKUPTABLES_H >> + #define __GLYPHLOOKUPTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct GlyphLookupTableHeader >> + { >> + fixed32 version; >> +@@ -46,4 +53,7 @@ >> + le_bool coversScriptAndLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch = FALSE) const; >> + }; >> + >> ++U_NAMESPACE_END >> ++ >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "LEFontInstance.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define CHECK_ALLOCATE_ARRAY(array, type, size) \ >> + if (array == NULL) { \ >> + array = (type *) new type[size]; \ >> +@@ -185,3 +187,5 @@ >> + >> + return NULL; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositionAdjustments.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,16 +32,23 @@ >> + #ifndef __GLYPHPOSITIONADJUSTMENTS_H >> + #define __GLYPHPOSITIONADJUSTMENTS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + class LEFontInstance; >> + >> +-class GlyphPositionAdjustments >> ++class GlyphPositionAdjustments : public UMemory >> + { >> + private: >> +- class Adjustment { >> ++ class Adjustment : public UMemory { >> + public: >> + >> + inline Adjustment(); >> +@@ -78,7 +85,7 @@ >> + // allow copying of this class because all of its fields are simple types >> + }; >> + >> +- class EntryExitPoint >> ++ class EntryExitPoint : public UMemory >> + { >> + public: >> + inline EntryExitPoint(); >> +@@ -144,14 +151,11 @@ >> + inline void adjustXAdvance(le_int32 index, float xAdjustment); >> + inline void adjustYAdvance(le_int32 index, float yAdjustment); >> + >> +- void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, >> +- le_bool baselineIsLogicalEnd); >> +- void setExitPoint(le_int32 index, LEPoint &newExitPoint, >> +- le_bool baselineIsLogicalEnd); >> ++ void setEntryPoint(le_int32 index, LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd); >> ++ void setExitPoint(le_int32 index, LEPoint &newExitPoint, le_bool baselineIsLogicalEnd); >> + void setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd); >> + >> +- void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, >> +- const LEFontInstance *fontInstance); >> ++ void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft, const LEFontInstance *fontInstance); >> + }; >> + >> + inline GlyphPositionAdjustments::Adjustment::Adjustment() >> +@@ -160,10 +164,8 @@ >> + // nothing else to do! >> + } >> + >> +-inline GlyphPositionAdjustments::Adjustment::Adjustment(float xPlace, float yPlace, >> +- float xAdv, float yAdv, le_int32 baseOff) >> +- : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv), >> +- baseOffset(baseOff) >> ++inline GlyphPositionAdjustments::Adjustment::Adjustment(float xPlace, float yPlace, float xAdv, float yAdv, le_int32 baseOff) >> ++ : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv), baseOffset(baseOff) >> + { >> + // nothing else to do! >> + } >> +@@ -246,7 +248,7 @@ >> + inline GlyphPositionAdjustments::EntryExitPoint::EntryExitPoint() >> + : fFlags(0) >> + { >> +- fEntryPoint.fX = fEntryPoint.fY = fExitPoint.fX = fEntryPoint.fY = 0; >> ++ fEntryPoint.fX = fEntryPoint.fY = fExitPoint.fX = fExitPoint.fY = 0; >> + } >> + >> + inline GlyphPositionAdjustments::EntryExitPoint::~EntryExitPoint() >> +@@ -264,12 +266,10 @@ >> + return (fFlags & EEF_BASELINE_IS_LOGICAL_END) != 0; >> + } >> + >> +-inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint( >> +- LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) >> ++inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd) >> + { >> + if (baselineIsLogicalEnd) { >> +- fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH | >> +- EEF_BASELINE_IS_LOGICAL_END); >> ++ fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); >> + } else { >> + fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH); >> + } >> +@@ -277,12 +277,10 @@ >> + fEntryPoint = newEntryPoint; >> + } >> + >> +-inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint( >> +- LEPoint &newExitPoint, le_bool baselineIsLogicalEnd) >> ++inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd) >> + { >> + if (baselineIsLogicalEnd) { >> +- fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH | >> +- EEF_BASELINE_IS_LOGICAL_END); >> ++ fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); >> + } else { >> + fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH); >> + } >> +@@ -290,8 +288,7 @@ >> + fExitPoint = newExitPoint; >> + } >> + >> +-inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph( >> +- le_bool baselineIsLogicalEnd) >> ++inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph(le_bool baselineIsLogicalEnd) >> + { >> + if (baselineIsLogicalEnd) { >> + fFlags |= (EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END); >> +@@ -386,4 +383,5 @@ >> + return fEntryExitPoints != NULL; >> + } >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositioningTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -40,18 +39,18 @@ >> + #include "LEGlyphStorage.h" >> + #include "GlyphPositionAdjustments.h" >> + >> +-void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, >> +- GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, >> +- LETag scriptTag, LETag languageTag, >> +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEFontInstance *fontInstance, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const >> ++U_NAMESPACE_BEGIN >> ++ >> ++void GlyphPositioningTableHeader::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, le_bool rightToLeft, >> ++ LETag scriptTag, LETag languageTag, >> ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> ++ const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const >> + { >> +- GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, >> +- featureMapCount, featureOrder); >> ++ GlyphPositioningLookupProcessor processor(this, scriptTag, languageTag, featureMap, featureMapCount, featureOrder); >> + >> +- processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, >> +- glyphDefinitionTableHeader, fontInstance); >> ++ processor.process(glyphStorage, glyphPositionAdjustments, rightToLeft, glyphDefinitionTableHeader, fontInstance); >> + >> + glyphPositionAdjustments->applyCursiveAdjustments(glyphStorage, rightToLeft, fontInstance); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPositioningTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPositioningTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,11 +31,18 @@ >> + #ifndef __GLYPHPOSITIONINGTABLES_H >> + #define __GLYPHPOSITIONINGTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "Lookups.h" >> + #include "GlyphLookupTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEFontInstance; >> + class LEGlyphStorage; >> + class LEGlyphFilter; >> +@@ -45,12 +51,10 @@ >> + >> + struct GlyphPositioningTableHeader : public GlyphLookupTableHeader >> + { >> +- void process(LEGlyphStorage &glyphStorage, >> +- GlyphPositionAdjustments *glyphPositionAdjustments, >> ++ void process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, >> + le_bool rightToLeft, LETag scriptTag, LETag languageTag, >> + const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEFontInstance *fontInstance, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; >> ++ const LEFontInstance *fontInstance, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; >> + }; >> + >> + enum GlyphPositioningSubtableTypes >> +@@ -68,4 +72,5 @@ >> + >> + typedef LookupSubtable GlyphPositioningSubtable; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved >> + * >> + */ >> +@@ -50,6 +49,8 @@ >> + #include "GlyphPosnLookupProc.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // Aside from the names, the contextual positioning subtables are >> + // the same as the contextual substitution subtables. >> + typedef ContextualSubstitutionSubtable ContextualPositioningSubtable; >> +@@ -57,8 +58,7 @@ >> + >> + GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor( >> + const GlyphPositioningTableHeader *glyphPositioningTableHeader, >> +- LETag scriptTag, LETag languageTag, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) >> ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) >> + : LookupProcessor( >> + (char *) glyphPositioningTableHeader, >> + SWAPW(glyphPositioningTableHeader->scriptListOffset), >> +@@ -166,3 +166,5 @@ >> + GlyphPositioningLookupProcessor::~GlyphPositioningLookupProcessor() >> + { >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphPosnLookupProc.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,6 +31,11 @@ >> + #ifndef __GLYPHPOSITIONINGLOOKUPPROCESSOR_H >> + #define __GLYPHPOSITIONINGLOOKUPPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -42,12 +46,13 @@ >> + #include "GlyphIterator.h" >> + #include "LookupProcessor.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class GlyphPositioningLookupProcessor : public LookupProcessor >> + { >> + public: >> + GlyphPositioningLookupProcessor(const GlyphPositioningTableHeader *glyphPositioningTableHeader, >> +- LETag scriptTag, LETag languageTag, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); >> ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); >> + >> + virtual ~GlyphPositioningLookupProcessor(); >> + >> +@@ -63,4 +68,5 @@ >> + GlyphPositioningLookupProcessor &operator=(const GlyphPositioningLookupProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -48,17 +48,17 @@ >> + #include "GlyphSubstLookupProc.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor( >> + const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, >> +- LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) >> ++ LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) >> + : LookupProcessor( >> + (char *) glyphSubstitutionTableHeader, >> + SWAPW(glyphSubstitutionTableHeader->scriptListOffset), >> + SWAPW(glyphSubstitutionTableHeader->featureListOffset), >> + SWAPW(glyphSubstitutionTableHeader->lookupListOffset), >> +- scriptTag, languageTag, featureMap, featureMapCount, featureOrder) >> +- , fFilter(filter) >> ++ scriptTag, languageTag, featureMap, featureMapCount, featureOrder), fFilter(filter) >> + { >> + // anything? >> + } >> +@@ -143,3 +143,5 @@ >> + GlyphSubstitutionLookupProcessor::~GlyphSubstitutionLookupProcessor() >> + { >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstLookupProc.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,6 +31,11 @@ >> + #ifndef __GLYPHSUBSTITUTIONLOOKUPPROCESSOR_H >> + #define __GLYPHSUBSTITUTIONLOOKUPPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "LEFontInstance.h" >> +@@ -43,12 +47,13 @@ >> + #include "GlyphIterator.h" >> + #include "LookupProcessor.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class GlyphSubstitutionLookupProcessor : public LookupProcessor >> + { >> + public: >> + GlyphSubstitutionLookupProcessor(const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader, >> +- LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, >> +- const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); >> ++ LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder); >> + >> + virtual ~GlyphSubstitutionLookupProcessor(); >> + >> +@@ -65,4 +70,5 @@ >> + GlyphSubstitutionLookupProcessor &operator=(const GlyphSubstitutionLookupProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -40,14 +40,15 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> +-le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, >> +- le_bool rightToLeft, LETag scriptTag, LETag languageTag, >> +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEGlyphFilter *filter, const FeatureMap *featureMap, >> +- le_int32 featureMapCount, le_bool featureOrder) const >> ++U_NAMESPACE_BEGIN >> ++ >> ++le_int32 GlyphSubstitutionTableHeader::process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, >> ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> ++ const LEGlyphFilter *filter, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const >> + { >> +- GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, >> +- featureMapCount, featureOrder); >> ++ GlyphSubstitutionLookupProcessor processor(this, scriptTag, languageTag, filter, featureMap, featureMapCount, featureOrder); >> + >> + return processor.process(glyphStorage, NULL, rightToLeft, glyphDefinitionTableHeader, NULL); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/GlyphSubstitutionTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstitutionTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,22 +32,27 @@ >> + #ifndef __GLYPHSUBSTITUTIONTABLES_H >> + #define __GLYPHSUBSTITUTIONTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + #include "Lookups.h" >> + #include "GlyphLookupTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + class LEGlyphFilter; >> + struct GlyphDefinitionTableHeader; >> + >> + struct GlyphSubstitutionTableHeader : public GlyphLookupTableHeader >> + { >> +- le_int32 process(LEGlyphStorage &glyphStorage, >> +- le_bool rightToLeft, LETag scriptTag, LETag languageTag, >> +- const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEGlyphFilter *filter, const FeatureMap *featureMap, >> +- le_int32 featureMapCount, le_bool featureOrder) const; >> ++ le_int32 process(LEGlyphStorage &glyphStorage, le_bool rightToLeft, LETag scriptTag, LETag languageTag, >> ++ const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEGlyphFilter *filter, >> ++ const FeatureMap *featureMap, le_int32 featureMapCount, le_bool featureOrder) const; >> + }; >> + >> + enum GlyphSubstitutionSubtableTypes >> +@@ -64,4 +69,5 @@ >> + >> + typedef LookupSubtable GlyphSubstitutionSubtable; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/HanLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/HanLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * HanLayoutEngine.cpp: OpenType processing for Han fonts. >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. >> +@@ -41,6 +40,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(HanOpenTypeLayoutEngine) >> ++ >> + #define loclFeatureTag LE_LOCL_FEATURE_TAG >> + #define smplFeatureTag LE_SMPL_FEATURE_TAG >> + #define tradFeatureTag LE_TRAD_FEATURE_TAG >> +@@ -60,9 +63,8 @@ >> + >> + #define features (loclFeatureMask) >> + >> +-HanOpenTypeLayoutEngine::HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- const GlyphSubstitutionTableHeader *gsubTable) >> ++HanOpenTypeLayoutEngine::HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) >> + { >> + fFeatureMap = featureMap; >> +@@ -74,9 +76,8 @@ >> + // nothing to do >> + } >> + >> +-le_int32 HanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, >> +- LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 HanOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, >> ++ LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -104,3 +105,5 @@ >> + >> + return count; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/HanLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/HanLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,8 +23,8 @@ >> + * >> + */ >> + >> ++ >> + /* >> +- * >> + * HanLayoutEngine.h: OpenType processing for Han fonts. >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved. >> +@@ -40,6 +40,8 @@ >> + >> + #include "GlyphSubstitutionTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + /** >> +@@ -69,9 +71,8 @@ >> + * >> + * @internal >> + */ >> +- HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, >> +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> ++ HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> + >> + >> + /** >> +@@ -81,6 +82,20 @@ >> + */ >> + virtual ~HanOpenTypeLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + >> + /** >> +@@ -92,10 +107,8 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in a >> +- * right to left directional run >> +- * @param glyphStorage - the object holding the glyph storage. The char >> +- * index and auxillary data arrays will be set. >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> ++ * @param glyphStorage - the object holding the glyph storage. The char index and auxillary data arrays will be set. >> + * >> + * Output parameters: >> + * @param outChars - the output character arrayt >> +@@ -107,9 +120,10 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicClassTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicClassTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "OpenTypeUtilities.h" >> + #include "IndicReordering.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // Split matra table indices >> + #define _x1 (1 << CF_INDEX_SHIFT) >> + #define _x2 (2 << CF_INDEX_SHIFT) >> +@@ -385,3 +387,5 @@ >> + >> + return classTable->getWorstCaseExpansion(); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -45,20 +45,20 @@ >> + >> + #include "IndicReordering.h" >> + >> +-IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- const GlyphSubstitutionTableHeader *gsubTable) >> +- : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable), >> +- fMPreFixups(NULL) >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicOpenTypeLayoutEngine) >> ++ >> ++IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> ++ : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable), fMPreFixups(NULL) >> + { >> + fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); >> + fFeatureOrder = TRUE; >> + } >> + >> +-IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> +- : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), >> +- fMPreFixups(NULL) >> ++IndicOpenTypeLayoutEngine::IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++ : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fMPreFixups(NULL) >> + { >> + fFeatureMap = IndicReordering::getFeatureMap(fFeatureMapCount); >> + fFeatureOrder = TRUE; >> +@@ -71,9 +71,8 @@ >> + >> + // Input: characters, tags >> + // Output: glyphs, char indices >> +-le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 IndicOpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -84,8 +83,7 @@ >> + return 0; >> + } >> + >> +- le_int32 retCount = OpenTypeLayoutEngine::glyphProcessing(chars, offset, count, max, >> +- rightToLeft, glyphStorage, success); >> ++ le_int32 retCount = OpenTypeLayoutEngine::glyphProcessing(chars, offset, count, max, rightToLeft, glyphStorage, success); >> + >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -99,9 +97,8 @@ >> + // Input: characters >> + // Output: characters, char indices, tags >> + // Returns: output character count >> +-le_int32 IndicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 IndicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -131,9 +128,10 @@ >> + >> + // NOTE: assumes this allocates featureTags... >> + // (probably better than doing the worst case stuff here...) >> +- le_int32 outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, >> +- outChars, glyphStorage, &fMPreFixups); >> ++ le_int32 outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups); >> ++ >> + glyphStorage.adoptGlyphCount(outCharCount); >> +- >> + return outCharCount; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -43,6 +43,8 @@ >> + #include "GlyphDefinitionTables.h" >> + #include "GlyphPositioningTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class MPreFixups; >> + class LEGlyphStorage; >> + >> +@@ -77,9 +79,8 @@ >> + * >> + * @internal >> + */ >> +- IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, >> +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> ++ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> + >> + /** >> + * This constructor is used when the font requires a "canned" GSUB table which can't be known >> +@@ -94,8 +95,8 @@ >> + * >> + * @internal >> + */ >> +- IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> ++ IndicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -104,6 +105,20 @@ >> + */ >> + virtual ~IndicOpenTypeLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + >> + /** >> +@@ -117,10 +132,9 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in a >> +- * right to left directional run >> +- * @param glyphStorage - the glyph storage object. The glyph and character >> +- * index arrays will be set. The auxillary data array will be set to the feature tags. >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> ++ * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. >> ++ * the auxillary data array will be set to the feature tags. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -129,9 +143,8 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method does character to glyph mapping, applies the GSUB table and applies >> +@@ -147,11 +160,9 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in a >> +- * right to left directional run >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> + * @param featureTags - the feature tag array >> +- * @param glyphStorage - the glyph storage object. The glyph and char >> +- * index arrays will be set. >> ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -163,12 +174,14 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, >> +- LEErrorCode &success); >> ++ virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + private: >> ++ >> + MPreFixups *fMPreFixups; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangement.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangement.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangement.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __INDICREARRANGEMENT_H >> + #define __INDICREARRANGEMENT_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "StateTables.h" >> + #include "MorphTables.h" >> + #include "MorphStateTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct IndicRearrangementSubtableHeader : MorphStateTableHeader >> + { >> + }; >> +@@ -78,4 +85,6 @@ >> + { >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(IndicRearrangementProcessor) >> ++ >> + IndicRearrangementProcessor::IndicRearrangementProcessor(const MorphSubtableHeader *morphSubtableHeader) >> + : StateTableProcessor(morphSubtableHeader) >> + { >> +@@ -56,8 +60,7 @@ >> + lastGlyph = 0; >> + } >> + >> +-ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphStorage, >> +- le_int32 &currGlyph, EntryTableIndex index) >> ++ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) >> + { >> + const IndicRearrangementStateEntry *entry = &entryTable[index]; >> + ByteOffset newState = SWAPW(entry->newStateOffset); >> +@@ -416,3 +419,5 @@ >> + break; >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicRearrangementProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicRearrangementProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __INDICREARRANGEMENTPROCESSOR_H >> + #define __INDICREARRANGEMENTPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "StateTableProcessor.h" >> + #include "IndicRearrangement.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class IndicRearrangementProcessor : public StateTableProcessor >> +@@ -54,12 +61,28 @@ >> + IndicRearrangementProcessor(const MorphSubtableHeader *morphSubtableHeader); >> + virtual ~IndicRearrangementProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + le_int32 firstGlyph; >> + le_int32 lastGlyph; >> + >> + const IndicRearrangementStateEntry *entryTable; >> + const IndicRearrangementSubtableHeader *indicRearrangementSubtableHeader; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicReordering.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "MPreFixups.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define initFeatureTag LE_INIT_FEATURE_TAG >> + #define nuktFeatureTag LE_NUKT_FEATURE_TAG >> + #define akhnFeatureTag LE_AKHN_FEATURE_TAG >> +@@ -71,7 +73,7 @@ >> + #define distFeatureMask 0x00020000UL >> + #define initFeatureMask 0x00010000UL >> + >> +-class ReorderingOutput { >> ++class ReorderingOutput : public UMemory { >> + private: >> + le_int32 fOutIndex; >> + LEUnicode *fOutChars; >> +@@ -187,8 +189,7 @@ >> + fOutIndex += 1; >> + } >> + >> +- le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, >> +- FeatureMask matraFeatures, le_bool wordStart) >> ++ le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, FeatureMask matraFeatures, le_bool wordStart) >> + { >> + IndicClassTable::CharClass matraClass = classTable->getCharClass(matra); >> + >> +@@ -219,13 +220,12 @@ >> + return FALSE; >> + } >> + >> +- void noteVowelModifier(const IndicClassTable *classTable, LEUnicode vowelModifier, >> +- le_uint32 vowelModifierIndex, FeatureMask vowelModifierFeatures) >> ++ void noteVowelModifier(const IndicClassTable *classTable, LEUnicode vowelModifier, le_uint32 vowelModifierIndex, FeatureMask vowelModifierFeatures) >> + { >> + IndicClassTable::CharClass vmClass = classTable->getCharClass(vowelModifier); >> + >> + fVMIndex = vowelModifierIndex; >> +- fVMFeatures = vowelModifierFeatures; >> ++ fVMFeatures = vowelModifierFeatures; >> + >> + if (IndicClassTable::isVowelModifier(vmClass)) { >> + switch (vmClass & CF_POS_MASK) { >> +@@ -244,13 +244,12 @@ >> + } >> + } >> + >> +- void noteStressMark(const IndicClassTable *classTable, LEUnicode stressMark, >> +- le_uint32 stressMarkIndex, FeatureMask stressMarkFeatures) >> ++ void noteStressMark(const IndicClassTable *classTable, LEUnicode stressMark, le_uint32 stressMarkIndex, FeatureMask stressMarkFeatures) >> + { >> + IndicClassTable::CharClass smClass = classTable->getCharClass(stressMark); >> + >> + fSMIndex = stressMarkIndex; >> +- fSMFeatures = stressMarkFeatures; >> ++ fSMFeatures = stressMarkFeatures; >> + >> + if (IndicClassTable::isStressMark(smClass)) { >> + switch (smClass & CF_POS_MASK) { >> +@@ -360,9 +359,7 @@ >> + }; >> + >> + // TODO: Find better names for these! >> +-#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | \ >> +- blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | \ >> +- blwmFeatureMask | abvmFeatureMask | distFeatureMask) >> ++#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | blwmFeatureMask | abvmFeatureMask | distFeatureMask) >> + #define tagArray3 (pstfFeatureMask | tagArray4) >> + #define tagArray2 (halfFeatureMask | tagArray3) >> + #define tagArray1 (blwfFeatureMask | tagArray2) >> +@@ -415,8 +412,7 @@ >> + return featureMap; >> + } >> + >> +-le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, >> +- const LEUnicode *chars, le_int32 prev, le_int32 charCount) >> ++le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) >> + { >> + le_int32 cursor = prev; >> + le_int8 state = 0; >> +@@ -752,3 +748,5 @@ >> + delete mpreFixups; >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/IndicReordering.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/IndicReordering.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/IndicReordering.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __INDICREORDERING_H >> + #define __INDICREORDERING_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // Characters that get refered to by name... >> + #define C_SIGN_ZWNJ 0x200C >> + #define C_SIGN_ZWJ 0x200D >> +@@ -140,7 +147,7 @@ >> + static const IndicClassTable *getScriptClassTable(le_int32 scriptCode); >> + }; >> + >> +-class IndicReordering { >> ++class IndicReordering /* not : public UObject because all methods are static */ { >> + public: >> + static le_int32 getWorstCaseExpansion(le_int32 scriptCode); >> + >> +@@ -156,8 +163,7 @@ >> + // do not instantiate >> + IndicReordering(); >> + >> +- static le_int32 findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, >> +- le_int32 prev, le_int32 charCount); >> ++ static le_int32 findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount); >> + >> + }; >> + >> +@@ -305,4 +311,5 @@ >> + return hasBelowBaseForm(getCharClass(ch)); >> + } >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KernTable.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KernTable.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KernTable.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 2004-2005 - All Rights Reserved >> + * >> + */ >> +@@ -39,6 +40,8 @@ >> + >> + #define DEBUG 0 >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct PairInfo { >> + le_uint32 key; // sigh, MSVC compiler gags on union here >> + le_int16 value; // fword, kern value in funits >> +@@ -191,6 +194,12 @@ >> + float adjust = 0; >> + for (int i = 1, e = storage.getGlyphCount(); i < e; ++i) { >> + key = key << 16 | (storage[i] & 0xffff); >> ++ >> ++ // argh, to do a binary search, we need to have the pair list in sorted order >> ++ // but it is not in sorted order on win32 platforms because of the endianness difference >> ++ // so either I have to swap the element each time I examine it, or I have to swap >> ++ // all the elements ahead of time and store them in the font >> ++ >> + const PairInfo* p = pairs; >> + const PairInfo* tp = (const PairInfo*)(p + rangeShift); >> + if (key > tp->key) { >> +@@ -238,3 +247,6 @@ >> + storage.adjustPosition(storage.getGlyphCount(), adjust, 0, success); >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KernTable.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KernTable.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KernTable.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 2004-2005 - All Rights Reserved >> + * >> + */ >> +@@ -37,9 +38,12 @@ >> + #endif >> + >> + #include "LETypes.h" >> ++//#include "LEFontInstance.h" >> ++//#include "LEGlyphStorage.h" >> + >> + #include >> + >> ++U_NAMESPACE_BEGIN >> + struct PairInfo; >> + class LEFontInstance; >> + class LEGlyphStorage; >> +@@ -67,4 +71,6 @@ >> + void process(LEGlyphStorage& storage); >> + }; >> + >> ++U_NAMESPACE_END >> ++ >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,8 +23,8 @@ >> + * >> + */ >> + >> ++ >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + * This file is a modification of the ICU file IndicLayoutEngine.cpp >> +@@ -38,17 +38,20 @@ >> + #include "LEGlyphStorage.h" >> + #include "KhmerReordering.h" >> + >> +-KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- const GlyphSubstitutionTableHeader *gsubTable) >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(KhmerOpenTypeLayoutEngine) >> ++ >> ++KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable) >> + { >> + fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); >> + fFeatureOrder = TRUE; >> + } >> + >> +-KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++KhmerOpenTypeLayoutEngine::KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags) >> + : OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) >> + { >> + fFeatureMap = KhmerReordering::getFeatureMap(fFeatureMapCount); >> +@@ -63,16 +66,14 @@ >> + // Input: characters >> + // Output: characters, char indices, tags >> + // Returns: output character count >> +-le_int32 KhmerOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 KhmerOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || >> +- offset >= max || offset + count > max) { >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> +@@ -96,9 +97,10 @@ >> + >> + // NOTE: assumes this allocates featureTags... >> + // (probably better than doing the worst case stuff here...) >> +- le_int32 outCharCount = KhmerReordering::reorder(&chars[offset], count, >> +- fScriptCode, outChars, glyphStorage); >> ++ le_int32 outCharCount = KhmerReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage); >> + >> + glyphStorage.adoptGlyphCount(outCharCount); >> + return outCharCount; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,6 +23,7 @@ >> + * >> + */ >> + >> ++ >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> +@@ -45,19 +46,18 @@ >> + // #include "GlyphDefinitionTables.h" >> + // #include "GlyphPositioningTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // class MPreFixups; >> + // class LEGlyphStorage; >> + >> + /** >> + * This class implements OpenType layout for Khmer OpenType fonts, as >> +- * specified by Microsoft in "Creating and Supporting OpenType Fonts >> +- * for Khmer Scripts" >> +- * (http://www.microsoft.com/typography/otspec/indicot/default.htm) >> +- * TODO: change url >> ++ * specified by Microsoft in "Creating and Supporting OpenType Fonts for >> ++ * Khmer Scripts" (http://www.microsoft.com/typography/otspec/indicot/default.htm) TODO: change url >> + * >> +- * This class overrides the characterProcessing method to do Khmer >> +- * character processing and reordering (See the MS spec. for more >> +- * details) >> ++ * This class overrides the characterProcessing method to do Khmer character processing >> ++ * and reordering (See the MS spec. for more details) >> + * >> + * @internal >> + */ >> +@@ -65,11 +65,10 @@ >> + { >> + public: >> + /** >> +- * This is the main constructor. It constructs an instance of >> +- * KhmerOpenTypeLayoutEngine for a particular font, script and >> +- * language. It takes the GSUB table as a parameter since >> +- * LayoutEngine::layoutEngineFactory has to read the GSUB table to >> +- * know that it has an Khmer OpenType font. >> ++ * This is the main constructor. It constructs an instance of KhmerOpenTypeLayoutEngine for >> ++ * a particular font, script and language. It takes the GSUB table as a parameter since >> ++ * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an >> ++ * Khmer OpenType font. >> + * >> + * @param fontInstance - the font >> + * @param scriptCode - the script >> +@@ -82,14 +81,12 @@ >> + * >> + * @internal >> + */ >> +- KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- const GlyphSubstitutionTableHeader *gsubTable); >> ++ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> + >> + /** >> +- * This constructor is used when the font requires a "canned" GSUB >> +- * table which can't be known until after this constructor has >> +- * been invoked. >> ++ * This constructor is used when the font requires a "canned" GSUB table which can't be known >> ++ * until after this constructor has been invoked. >> + * >> + * @param fontInstance - the font >> + * @param scriptCode - the script >> +@@ -100,8 +97,8 @@ >> + * >> + * @internal >> + */ >> +- KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> ++ KhmerOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -110,25 +107,35 @@ >> + */ >> + virtual ~KhmerOpenTypeLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + >> + /** >> +- * This method does Khmer OpenType character processing. It >> +- * assigns the OpenType feature tags to the characters, and may >> +- * generate output characters which have been reordered. It may >> +- * also split some vowels, resulting in more output characters >> +- * than input characters. >> ++ * This method does Khmer OpenType character processing. It assigns the OpenType feature >> ++ * tags to the characters, and may generate output characters which have been reordered. >> ++ * It may also split some vowels, resulting in more output characters than input characters. >> + * >> + * Input parameters: >> + * @param chars - the input character context >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in >> +- * a right to left directional run >> +- * @param glyphStorage - the glyph storage object. The glyph and >> +- * character index arrays will be set. the auxillary data array >> +- * will be set to the feature tags. >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> ++ * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. >> ++ * the auxillary data array will be set to the feature tags. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -137,9 +144,11 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerReordering.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerReordering.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,9 @@ >> + #include "KhmerReordering.h" >> + #include "LEGlyphStorage.h" >> + >> ++ >> ++U_NAMESPACE_BEGIN >> ++ >> + // Characters that get refered to by name... >> + enum >> + { >> +@@ -53,35 +56,23 @@ >> + >> + enum >> + { >> +- // simple classes, they are used in the statetable (in this file) >> +- // to control the length of a syllable they are also used to know >> +- // where a character should be placed (location in reference to >> +- // the base character) and also to know if a character, when >> +- // independtly displayed, should be displayed with a dotted-circle >> +- // to indicate error in syllable construction >> +- >> ++ // simple classes, they are used in the statetable (in this file) to control the length of a syllable >> ++ // they are also used to know where a character should be placed (location in reference to the base character) >> ++ // and also to know if a character, when independtly displayed, should be displayed with a dotted-circle to >> ++ // indicate error in syllable construction >> + _xx = KhmerClassTable::CC_RESERVED, >> +- _sa = KhmerClassTable::CC_SIGN_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE >> +- | KhmerClassTable::CF_POS_ABOVE, >> +- _sp = KhmerClassTable::CC_SIGN_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE >> +- | KhmerClassTable::CF_POS_AFTER, >> ++ _sa = KhmerClassTable::CC_SIGN_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_POS_ABOVE, >> ++ _sp = KhmerClassTable::CC_SIGN_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE| KhmerClassTable::CF_POS_AFTER, >> + _c1 = KhmerClassTable::CC_CONSONANT | KhmerClassTable::CF_CONSONANT, >> + _c2 = KhmerClassTable::CC_CONSONANT2 | KhmerClassTable::CF_CONSONANT, >> + _c3 = KhmerClassTable::CC_CONSONANT3 | KhmerClassTable::CF_CONSONANT, >> +- _rb = KhmerClassTable::CC_ROBAT | KhmerClassTable::CF_POS_ABOVE >> +- | KhmerClassTable::CF_DOTTED_CIRCLE, >> +- _cs = KhmerClassTable::CC_CONSONANT_SHIFTER | KhmerClassTable::CF_DOTTED_CIRCLE >> +- | KhmerClassTable::CF_SHIFTER, >> +- _dl = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BEFORE >> +- | KhmerClassTable::CF_DOTTED_CIRCLE, >> +- _db = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BELOW >> +- | KhmerClassTable::CF_DOTTED_CIRCLE, >> +- _da = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_ABOVE >> +- | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_ABOVE_VOWEL, >> +- _dr = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_AFTER >> +- | KhmerClassTable::CF_DOTTED_CIRCLE, >> +- _co = KhmerClassTable::CC_COENG | KhmerClassTable::CF_COENG >> +- | KhmerClassTable::CF_DOTTED_CIRCLE, >> ++ _rb = KhmerClassTable::CC_ROBAT | KhmerClassTable::CF_POS_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE, >> ++ _cs = KhmerClassTable::CC_CONSONANT_SHIFTER | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_SHIFTER, >> ++ _dl = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BEFORE | KhmerClassTable::CF_DOTTED_CIRCLE, >> ++ _db = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_BELOW | KhmerClassTable::CF_DOTTED_CIRCLE, >> ++ _da = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_ABOVE | KhmerClassTable::CF_DOTTED_CIRCLE | KhmerClassTable::CF_ABOVE_VOWEL, >> ++ _dr = KhmerClassTable::CC_DEPENDENT_VOWEL | KhmerClassTable::CF_POS_AFTER | KhmerClassTable::CF_DOTTED_CIRCLE, >> ++ _co = KhmerClassTable::CC_COENG | KhmerClassTable::CF_COENG | KhmerClassTable::CF_DOTTED_CIRCLE, >> + >> + // split vowel >> + _va = _da | KhmerClassTable::CF_SPLIT_VOWEL, >> +@@ -90,13 +81,10 @@ >> + >> + >> + // Character class tables >> +- >> +-// _xx character does not combine into syllable, such as numbers, >> +-// puntuation marks, non-Khmer signs... >> ++// _xx character does not combine into syllable, such as numbers, puntuation marks, non-Khmer signs... >> + // _sa Sign placed above the base >> + // _sp Sign placed after the base >> +-// _c1 Consonant of type 1 or independent vowel (independent vowels >> +-// behave as type 1 consonants) >> ++// _c1 Consonant of type 1 or independent vowel (independent vowels behave as type 1 consonants) >> + // _c2 Consonant of type 2 (only RO) >> + // _c3 Consonant of type 3 >> + // _rb Khmer sign robat u17CC. combining mark for subscript consonants >> +@@ -105,13 +93,10 @@ >> + // _db Dependent vowel placed below the base >> + // _da Dependent vowel placed above the base >> + // _dr Dependent vowel placed behind the base (right of the base) >> +-// _co Khmer combining mark COENG u17D2, combines with the consonant >> +-// or independent vowel following it to create a subscript consonant >> +-// or independent vowel >> +-// _va Khmer split vowel in wich the first part is before the base and >> +-// the second one above the base >> +-// _vr Khmer split vowel in wich the first part is before the base and >> +-// the second one behind (right of) the base >> ++// _co Khmer combining mark COENG u17D2, combines with the consonant or independent vowel following >> ++// it to create a subscript consonant or independent vowel >> ++// _va Khmer split vowel in wich the first part is before the base and the second one above the base >> ++// _vr Khmer split vowel in wich the first part is before the base and the second one behind (right of) the base >> + >> + static const KhmerClassTable::CharClass khmerCharClasses[] = >> + { >> +@@ -129,19 +114,19 @@ >> + // >> + >> + // >> +-// The range of characters defined in the above table is defined >> +-// here. FOr Khmer 1780 to 17DF Even if the Khmer range is bigger, all >> +-// other characters are not combinable, and therefore treated as _xx >> ++// The range of characters defined in the above table is defined here. FOr Khmer 1780 to 17DF >> ++// Even if the Khmer range is bigger, all other characters are not combinable, and therefore treated >> ++// as _xx >> + static const KhmerClassTable khmerClassTable = {0x1780, 0x17df, khmerCharClasses}; >> + >> + >> +-// Below we define how a character in the input string is either in >> +-// the khmerCharClasses table (in which case we get its type back), a >> +-// ZWJ or ZWNJ (two characters that may appear within the syllable, >> +-// but are not in the table) we also get their type back, or an >> +-// unknown object in which case we get _xx (CC_RESERVED) back >> ++// Below we define how a character in the input string is either in the khmerCharClasses table >> ++// (in which case we get its type back), a ZWJ or ZWNJ (two characters that may appear >> ++// within the syllable, but are not in the table) we also get their type back, or an unknown object >> ++// in which case we get _xx (CC_RESERVED) back >> + KhmerClassTable::CharClass KhmerClassTable::getCharClass(LEUnicode ch) const >> + { >> ++ >> + if (ch == C_SIGN_ZWJ) { >> + return CC_ZERO_WIDTH_J_MARK; >> + } >> +@@ -164,13 +149,14 @@ >> + >> + >> + >> +-class ReorderingOutput { >> ++class ReorderingOutput : public UMemory { >> + private: >> + le_int32 fOutIndex; >> + LEUnicode *fOutChars; >> + >> + LEGlyphStorage &fGlyphStorage; >> + >> ++ >> + public: >> + ReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage) >> + : fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage) >> +@@ -232,18 +218,11 @@ >> + #define abvmFeatureMask 0x00100000UL >> + #define mkmkFeatureMask 0x00080000UL >> + >> +-#define tagPref (prefFeatureMask | presFeatureMask | \ >> +- cligFeatureMask | distFeatureMask) >> +-#define tagAbvf (abvfFeatureMask | abvsFeatureMask | \ >> +- cligFeatureMask | distFeatureMask | abvmFeatureMask | mkmkFeatureMask) >> +-#define tagPstf (blwfFeatureMask | blwsFeatureMask | prefFeatureMask | \ >> +- presFeatureMask | pstfFeatureMask | pstsFeatureMask | cligFeatureMask | \ >> +- distFeatureMask | blwmFeatureMask) >> +-#define tagBlwf (blwfFeatureMask | blwsFeatureMask | cligFeatureMask | \ >> +- distFeatureMask | blwmFeatureMask | mkmkFeatureMask) >> +-#define tagDefault (prefFeatureMask | blwfFeatureMask | presFeatureMask | \ >> +- blwsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | \ >> +- blwmFeatureMask | mkmkFeatureMask) >> ++#define tagPref (prefFeatureMask | presFeatureMask | cligFeatureMask | distFeatureMask) >> ++#define tagAbvf (abvfFeatureMask | abvsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | mkmkFeatureMask) >> ++#define tagPstf (blwfFeatureMask | blwsFeatureMask | prefFeatureMask | presFeatureMask | pstfFeatureMask | pstsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask) >> ++#define tagBlwf (blwfFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | blwmFeatureMask | mkmkFeatureMask) >> ++#define tagDefault (prefFeatureMask | blwfFeatureMask | presFeatureMask | blwsFeatureMask | cligFeatureMask | distFeatureMask | abvmFeatureMask | blwmFeatureMask | mkmkFeatureMask) >> + >> + >> + >> +@@ -274,35 +253,32 @@ >> + // The stateTable is used to calculate the end (the length) of a well >> + // formed Khmer Syllable. >> + // >> +-// Each horizontal line is ordered exactly the same way as the values >> +-// in KhmerClassTable CharClassValues in KhmerReordering.h This >> +-// coincidence of values allows the follow up of the table. >> ++// Each horizontal line is ordered exactly the same way as the values in KhmerClassTable >> ++// CharClassValues in KhmerReordering.h This coincidence of values allows the >> ++// follow up of the table. >> + // >> +-// Each line corresponds to a state, which does not necessarily need >> +-// to be a type of component... for example, state 2 is a base, with >> +-// is always a first character in the syllable, but the state could be >> +-// produced a consonant of any type when it is the first character >> +-// that is analysed (in ground state). >> ++// Each line corresponds to a state, which does not necessarily need to be a type >> ++// of component... for example, state 2 is a base, with is always a first character >> ++// in the syllable, but the state could be produced a consonant of any type when >> ++// it is the first character that is analysed (in ground state). >> + // >> + // Differentiating 3 types of consonants is necessary in order to >> + // forbid the use of certain combinations, such as having a second >> +-// coeng after a coeng RO. >> +-// The inexistent possibility of having a type 3 after another type 3 >> +-// is permitted, eliminating it would very much complicate the table, >> +-// and it does not create typing problems, as the case above. >> ++// coeng after a coeng RO, >> ++// The inexistent possibility of having a type 3 after another type 3 is permitted, >> ++// eliminating it would very much complicate the table, and it does not create typing >> ++// problems, as the case above. >> + // >> +-// The table is quite complex, in order to limit the number of coeng >> +-// consonants to 2 (by means of the table). >> ++// The table is quite complex, in order to limit the number of coeng consonants >> ++// to 2 (by means of the table). >> + // >> + // There a peculiarity, as far as Unicode is concerned: >> + // - The consonant-shifter is considered in two possible different >> +-// locations, the one considered in Unicode 3.0 and the one considered >> +-// in Unicode 4.0. (there is a backwards compatibility problem in this >> +-// standard). >> ++// locations, the one considered in Unicode 3.0 and the one considered in >> ++// Unicode 4.0. (there is a backwards compatibility problem in this standard). >> + >> + >> +-// xx independent character, such as a number, punctuation sign or >> +-// non-khmer char >> ++// xx independent character, such as a number, punctuation sign or non-khmer char >> + // >> + // c1 Khmer consonant of type 1 or an independent vowel >> + // that is, a letter in which the subscript for is only under the >> +@@ -320,10 +296,9 @@ >> + // >> + // co coeng character (u17D2) >> + // >> +-// dv dependent vowel (including split vowels, they are treated in the >> +-// same way). even if dv is not defined above, the component that is >> +-// really tested for is KhmerClassTable::CC_DEPENDENT_VOWEL, which is >> +-// common to all dependent vowels >> ++// dv dependent vowel (including split vowels, they are treated in the same way). >> ++// even if dv is not defined above, the component that is really tested for is >> ++// KhmerClassTable::CC_DEPENDENT_VOWEL, which is common to all dependent vowels >> + // >> + // zwj Zero Width joiner >> + // >> +@@ -352,8 +327,7 @@ >> + {-1, -1, -1, -1, 12, 13, -1, -1, 16, 17, 1, 14}, // 8 - First consonant of type 2 after coeng >> + {-1, -1, -1, -1, 12, 13, -1, 10, 16, 17, 1, 14}, // 9 - First consonant or type 3 after ceong >> + {-1, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, -1}, // 10 - Second Coeng (no register shifter before) >> +- {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 11 - Second coeng consonant >> +- // (or ind. vowel) no register shifter before >> ++ {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 11 - Second coeng consonant (or ind. vowel) no register shifter before >> + {-1, -1, 1, -1, -1, 13, -1, -1, 16, -1, -1, -1}, // 12 - Second ZWNJ before a register shifter >> + {-1, -1, -1, -1, 15, -1, -1, -1, 16, 17, 1, 14}, // 13 - Second register shifter >> + {-1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1}, // 14 - ZWJ before vowel >> +@@ -363,6 +337,7 @@ >> + {-1, -1, -1, -1, -1, -1, -1, 19, -1, -1, -1, -1}, // 18 - ZWJ after vowel >> + {-1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1}, // 19 - Third coeng >> + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1}, // 20 - dependent vowel after a Robat >> ++ >> + }; >> + >> + >> +@@ -377,15 +352,13 @@ >> + // Given an input string of characters and a location in which to start looking >> + // calculate, using the state table, which one is the last character of the syllable >> + // that starts in the starting position. >> +-le_int32 KhmerReordering::findSyllable(const KhmerClassTable *classTable, >> +- const LEUnicode *chars, le_int32 prev, le_int32 charCount) >> ++le_int32 KhmerReordering::findSyllable(const KhmerClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount) >> + { >> + le_int32 cursor = prev; >> + le_int8 state = 0; >> + >> + while (cursor < charCount) { >> +- KhmerClassTable::CharClass charClass = (classTable->getCharClass(chars[cursor]) >> +- & KhmerClassTable::CF_CLASS_MASK); >> ++ KhmerClassTable::CharClass charClass = (classTable->getCharClass(chars[cursor]) & KhmerClassTable::CF_CLASS_MASK); >> + >> + state = khmerStateTable[state][charClass]; >> + >> +@@ -402,8 +375,8 @@ >> + >> + // This is the real reordering function as applied to the Khmer language >> + >> +-le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, >> +- le_int32 /*scriptCode*/, LEUnicode *outChars, LEGlyphStorage &glyphStorage) >> ++le_int32 KhmerReordering::reorder(const LEUnicode *chars, le_int32 charCount, le_int32 /*scriptCode*/, >> ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage) >> + { >> + const KhmerClassTable *classTable = KhmerClassTable::getKhmerClassTable(); >> + >> +@@ -442,8 +415,7 @@ >> + // and because CC_CONSONANT2 is enough to identify it, as it is the only consonant >> + // with this flag >> + if ( (charClass & KhmerClassTable::CF_COENG) && (i + 1 < syllable) && >> +- ( (classTable->getCharClass(chars[i + 1]) & >> +- KhmerClassTable::CF_CLASS_MASK) == KhmerClassTable::CC_CONSONANT2) ) >> ++ ( (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_CLASS_MASK) == KhmerClassTable::CC_CONSONANT2) ) >> + { >> + coengRo = i; >> + } >> +@@ -455,16 +427,15 @@ >> + output.writeChar(C_RO, coengRo + 1, tagPref); >> + } >> + >> +- // shall we add a dotted circle? If in the position in which >> +- // the base should be (first char in the string) there is a >> +- // character that has the Dotted circle flag (a character that >> +- // cannot be a base) then write a dotted circle >> ++ // shall we add a dotted circle? >> ++ // If in the position in which the base should be (first char in the string) there is >> ++ // a character that has the Dotted circle flag (a character that cannot be a base) >> ++ // then write a dotted circle >> + if (classTable->getCharClass(chars[prev]) & KhmerClassTable::CF_DOTTED_CIRCLE) { >> + output.writeChar(C_DOTTED_CIRCLE, prev, tagDefault); >> + } >> + >> +- // copy what is left to the output, skipping before vowels and >> +- // coeng Ro if they are present >> ++ // copy what is left to the output, skipping before vowels and coeng Ro if they are present >> + for (i = prev; i < syllable; i += 1) { >> + charClass = classTable->getCharClass(chars[i]); >> + >> +@@ -515,30 +486,14 @@ >> + // and there is an extra rule for C_VOWEL_AA + C_SIGN_NIKAHIT also for two >> + // different positions, right after the shifter or after a vowel (Unicode 4) >> + if ( (charClass & KhmerClassTable::CF_SHIFTER) && (i + 1 < syllable) ) { >> +- if (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_ABOVE_VOWEL ) { >> +- output.writeChar(chars[i], i, tagBlwf); >> +- break; >> +- } >> +- if (i + 2 < syllable && >> +- ( (classTable->getCharClass(chars[i + 1]) & >> +- KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) && >> +- ( (classTable->getCharClass(chars[i + 2]) & >> +- KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) >> +- { >> +- output.writeChar(chars[i], i, tagBlwf); >> +- break; >> +- } >> +- if (i + 3 < syllable && (classTable->getCharClass(chars[i + 3]) & >> +- KhmerClassTable::CF_ABOVE_VOWEL) ) >> +- { >> +- output.writeChar(chars[i], i, tagBlwf); >> +- break; >> +- } >> +- if (i + 4 < syllable && >> +- ( (classTable->getCharClass(chars[i + 3]) & >> +- KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) && >> +- ( (classTable->getCharClass(chars[i + 4]) & >> +- KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) >> ++ if ((classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_ABOVE_VOWEL) >> ++ || (i + 2 < syllable >> ++ && ( (classTable->getCharClass(chars[i + 1]) & KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) >> ++ && ( (classTable->getCharClass(chars[i + 2]) & KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT)) >> ++ || (i + 3 < syllable && (classTable->getCharClass(chars[i + 3]) & KhmerClassTable::CF_ABOVE_VOWEL)) >> ++ || (i + 4 < syllable >> ++ && ( (classTable->getCharClass(chars[i + 3]) & KhmerClassTable::CF_CLASS_MASK) == C_VOWEL_AA) >> ++ && ( (classTable->getCharClass(chars[i + 4]) & KhmerClassTable::CF_CLASS_MASK) == C_SIGN_NIKAHIT) ) ) >> + { >> + output.writeChar(chars[i], i, tagBlwf); >> + break; >> +@@ -556,3 +511,6 @@ >> + >> + return output.getOutputIndex(); >> + } >> ++ >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/KhmerReordering.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/KhmerReordering.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/KhmerReordering.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + * This file is a modification of the ICU file IndicReordering.h >> +@@ -35,80 +34,60 @@ >> + #ifndef __KHMERREORDERING_H >> + #define __KHMERREORDERING_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + // Vocabulary >> +- >> +-// Base -> >> +-// A consonant or an independent vowel in its full (not >> +-// subscript) form. It is the center of the syllable, it can be >> +-// souranded by coeng (subscript) consonants, vowels, split >> +-// vowels, signs... but there is only one base in a syllable, it >> +-// has to be coded as the first character of the syllable. >> +-// split vowel -> >> +-// vowel that has two parts placed separately (e.g. Before and >> +-// after the consonant). Khmer language has five of them. Khmer >> +-// split vowels either have one part before the base and one after >> +-// the base or they have a part before the base and a part above >> +-// the base. The first part of all Khmer split vowels is the same >> +-// character, identical to the glyph of Khmer dependent vowel SRA >> +-// EI >> +-// coeng -> >> +-// modifier used in Khmer to construct coeng (subscript) >> +-// consonants differently than indian languages, the coeng >> +-// modifies the consonant that follows it, not the one preceding >> +-// it Each consonant has two forms, the base form and the >> +-// subscript form the base form is the normal one (using the >> +-// consonants code-point), the subscript form is displayed when >> +-// the combination coeng + consonant is encountered. >> +-// Consonant of type 1 -> >> +-// A consonant which has subscript for that only occupies space >> +-// under a base consonant >> +-// Consonant of type 2 -> >> +-// Its subscript form occupies space under and before the base >> +-// (only one, RO) >> +-// Consonant of Type 3 -> >> +-// Its subscript form occupies space under and after the base >> +-// (KHO, CHHO, THHO, BA, YO, SA) >> +-// Consonant shifter -> >> +-// Khmer has to series of consonants. The same dependent vowel has >> +-// different sounds if it is attached to a consonant of the first >> +-// series or a consonant of the second series Most consonants have >> +-// an equivalent in the other series, but some of theme exist only >> +-// in one series (for example SA). If we want to use the consonant >> +-// SA with a vowel sound that can only be done with a vowel sound >> +-// that corresponds to a vowel accompanying a consonant of the >> +-// other series, then we need to use a consonant shifter: TRIISAP >> +-// or MUSIKATOAN x17C9 y x17CA. TRIISAP changes a first series >> +-// consonant to second series sound and MUSIKATOAN a second series >> +-// consonant to have a first series vowel sound. Consonant >> +-// shifter are both normally supercript marks, but, when they are >> +-// followed by a superscript, they change shape and take the form >> +-// of subscript dependent vowel SRA U. If they are in the same >> +-// syllable as a coeng consonant, Unicode 3.0 says that they >> +-// should be typed before the coeng. Unicode 4.0 breaks the >> +-// standard and says that it should be placed after the coeng >> +-// consonant. >> +-// Dependent vowel -> >> +-// In khmer dependent vowels can be placed above, below, before or >> +-// after the base Each vowel has its own position. Only one vowel >> +-// per syllable is allowed. >> +-// Signs -> >> +-// Khmer has above signs and post signs. Only one above sign >> +-// and/or one post sign are Allowed in a syllable. >> ++// Base -> A consonant or an independent vowel in its full (not subscript) form. It is the >> ++// center of the syllable, it can be souranded by coeng (subscript) consonants, vowels, >> ++// split vowels, signs... but there is only one base in a syllable, it has to be coded as >> ++// the first character of the syllable. >> ++// split vowel --> vowel that has two parts placed separately (e.g. Before and after the consonant). >> ++// Khmer language has five of them. Khmer split vowels either have one part before the >> ++// base and one after the base or they have a part before the base and a part above the base. >> ++// The first part of all Khmer split vowels is the same character, identical to >> ++// the glyph of Khmer dependent vowel SRA EI >> ++// coeng --> modifier used in Khmer to construct coeng (subscript) consonants >> ++// Differently than indian languages, the coeng modifies the consonant that follows it, >> ++// not the one preceding it Each consonant has two forms, the base form and the subscript form >> ++// the base form is the normal one (using the consonants code-point), the subscript form is >> ++// displayed when the combination coeng + consonant is encountered. >> ++// Consonant of type 1 -> A consonant which has subscript for that only occupies space under a base consonant >> ++// Consonant of type 2.-> Its subscript form occupies space under and before the base (only one, RO) >> ++// Consonant of Type 3 -> Its subscript form occupies space under and after the base (KHO, CHHO, THHO, BA, YO, SA) >> ++// Consonant shifter -> Khmer has to series of consonants. The same dependent vowel has different sounds >> ++// if it is attached to a consonant of the first series or a consonant of the second series >> ++// Most consonants have an equivalent in the other series, but some of theme exist only in >> ++// one series (for example SA). If we want to use the consonant SA with a vowel sound that >> ++// can only be done with a vowel sound that corresponds to a vowel accompanying a consonant >> ++// of the other series, then we need to use a consonant shifter: TRIISAP or MUSIKATOAN >> ++// x17C9 y x17CA. TRIISAP changes a first series consonant to second series sound and >> ++// MUSIKATOAN a second series consonant to have a first series vowel sound. >> ++// Consonant shifter are both normally supercript marks, but, when they are followed by a >> ++// superscript, they change shape and take the form of subscript dependent vowel SRA U. >> ++// If they are in the same syllable as a coeng consonant, Unicode 3.0 says that they >> ++// should be typed before the coeng. Unicode 4.0 breaks the standard and says that it should >> ++// be placed after the coeng consonant. >> ++// Dependent vowel -> In khmer dependent vowels can be placed above, below, before or after the base >> ++// Each vowel has its own position. Only one vowel per syllable is allowed. >> ++// Signs -> Khmer has above signs and post signs. Only one above sign and/or one post sign are >> ++// Allowed in a syllable. >> ++// >> + // >> + >> +-// This list must include all types of components that can be used >> +-// inside a syllable >> +-struct KhmerClassTable >> ++struct KhmerClassTable // This list must include all types of components that can be used inside a syllable >> + { >> +- // order is important here! This order must be the same that is >> +- // found in each horizontal line in the statetable for Khmer (file >> +- // KhmerReordering.cpp). >> +- enum CharClassValues >> ++ enum CharClassValues // order is important here! This order must be the same that is found in each horizontal >> ++ // line in the statetable for Khmer (file KhmerReordering.cpp). >> + { >> + CC_RESERVED = 0, >> + CC_CONSONANT = 1, // consonant of type 1 or independent vowel >> +@@ -116,8 +95,7 @@ >> + CC_CONSONANT3 = 3, // Consonant of type 3 >> + CC_ZERO_WIDTH_NJ_MARK = 4, // Zero Width non joiner character (0x200C) >> + CC_CONSONANT_SHIFTER = 5, >> +- CC_ROBAT = 6, // Khmer special diacritic accent >> +- // -treated differently in state table >> ++ CC_ROBAT = 6, // Khmer special diacritic accent -treated differently in state table >> + CC_COENG = 7, // Subscript consonant combining character >> + CC_DEPENDENT_VOWEL = 8, >> + CC_SIGN_ABOVE = 9, >> +@@ -131,10 +109,8 @@ >> + CF_CLASS_MASK = 0x0000FFFF, >> + >> + CF_CONSONANT = 0x01000000, // flag to speed up comparing >> +- CF_SPLIT_VOWEL = 0x02000000, // flag for a split vowel -> the first part >> +- // is added in front of the syllable >> +- CF_DOTTED_CIRCLE = 0x04000000, // add a dotted circle if a character with >> +- // this flag is the first in a syllable >> ++ CF_SPLIT_VOWEL = 0x02000000, // flag for a split vowel -> the first part is added in front of the syllable >> ++ CF_DOTTED_CIRCLE = 0x04000000, // add a dotted circle if a character with this flag is the first in a syllable >> + CF_COENG = 0x08000000, // flag to speed up comparing >> + CF_SHIFTER = 0x10000000, // flag to speed up comparing >> + CF_ABOVE_VOWEL = 0x20000000, // flag to speed up comparing >> +@@ -161,10 +137,10 @@ >> + }; >> + >> + >> +-class KhmerReordering { >> ++class KhmerReordering /* not : public UObject because all methods are static */ { >> + public: >> +- static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, >> +- le_int32 scriptCode, LEUnicode *outChars, LEGlyphStorage &glyphStorage); >> ++ static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, >> ++ LEUnicode *outChars, LEGlyphStorage &glyphStorage); >> + >> + static const FeatureMap *getFeatureMap(le_int32 &count); >> + >> +@@ -172,8 +148,10 @@ >> + // do not instantiate >> + KhmerReordering(); >> + >> +- static le_int32 findSyllable(const KhmerClassTable *classTable, >> +- const LEUnicode *chars, le_int32 prev, le_int32 charCount); >> ++ static le_int32 findSyllable(const KhmerClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount); >> ++ >> + }; >> + >> ++ >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEFontInstance.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEFontInstance.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + ******************************************************************************* >> + * >> + * Copyright (C) 1999-2005, International Business Machines >> +@@ -42,6 +41,10 @@ >> + #include "LEFontInstance.h" >> + #include "LEGlyphStorage.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEFontInstance) >> ++ >> + const LEFontInstance *LEFontInstance::getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, >> + le_int32 script, LEErrorCode &success) const >> + { >> +@@ -59,7 +62,7 @@ >> + } >> + >> + void LEFontInstance::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, >> +- le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const >> ++ le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const >> + { >> + le_int32 i, out = 0, dir = 1; >> + >> +@@ -100,3 +103,5 @@ >> + >> + return mapCharToGlyph(mappedChar); >> + } >> ++U_NAMESPACE_END >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEFontInstance.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEFontInstance.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEFontInstance.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,12 @@ >> + #define __LEFONTINSTANCE_H >> + >> + #include "LETypes.h" >> ++/** >> ++ * \file >> ++ * \brief C++ API: Layout Engine Font Instance object >> ++ */ >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + /** >> + * Instances of this class are used by LEFontInstance::mapCharsToGlyphs and >> +@@ -44,7 +50,7 @@ >> + * >> + * @stable ICU 3.2 >> + */ >> +-class LECharMapper >> ++class LECharMapper /* not : public UObject because this is an interface/mixin class */ >> + { >> + public: >> + /** >> +@@ -97,7 +103,7 @@ >> + * >> + * @draft ICU 3.0 >> + */ >> +-class LEFontInstance >> ++class U_LAYOUT_API LEFontInstance : public UObject >> + { >> + public: >> + >> +@@ -160,8 +166,7 @@ >> + * >> + * @stable ICU 3.2 >> + */ >> +- virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, >> +- le_int32 limit, le_int32 script, LEErrorCode &success) const; >> ++ virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const; >> + >> + // >> + // Font file access >> +@@ -238,8 +243,7 @@ >> + * >> + * @draft ICU 3.0 >> + */ >> +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, >> +- le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const; >> ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphStorage &glyphStorage) const; >> + >> + /** >> + * This method maps a single character to a glyph index, using the >> +@@ -502,6 +506,21 @@ >> + * @stable ICU 3.2 >> + */ >> + virtual le_int32 getLineHeight() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 3.2 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 3.2 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + }; >> + >> + inline le_bool LEFontInstance::canDisplay(LEUnicode32 ch) const >> +@@ -562,4 +581,7 @@ >> + return getAscent() + getDescent() + getLeading(); >> + } >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphFilter.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphFilter.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphFilter.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,14 +34,15 @@ >> + >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /** >> + * This is a helper class that is used to >> + * recognize a set of glyph indices. >> + * >> + * @internal >> + */ >> +-class LEGlyphFilter >> +-{ >> ++class LEGlyphFilter /* not : public UObject because this is an interface/mixin class */ { >> + public: >> + /** >> + * Destructor. >> +@@ -63,4 +64,5 @@ >> + virtual le_bool accept(LEGlyphID glyph) const = 0; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphStorage.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + ********************************************************************** >> + * Copyright (C) 1998-2005, International Business Machines >> + * Corporation and others. All Rights Reserved. >> +@@ -35,6 +34,10 @@ >> + #include "LEInsertionList.h" >> + #include "LEGlyphStorage.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEGlyphStorage) >> ++ >> + LEGlyphStorage::LEGlyphStorage() >> + : fGlyphCount(0), fGlyphs(NULL), fCharIndices(NULL), fPositions(NULL), >> + fAuxData(NULL), fInsertionList(NULL), fSrcIndex(0), fDestIndex(0) >> +@@ -603,3 +606,6 @@ >> + >> + return FALSE; >> + } >> ++ >> ++U_NAMESPACE_END >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEGlyphStorage.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEGlyphStorage.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + ********************************************************************** >> + * Copyright (C) 1998-2005, International Business Machines >> + * Corporation and others. All Rights Reserved. >> +@@ -38,6 +37,13 @@ >> + #include "LEInsertionList.h" >> + >> + /** >> ++ * \file >> ++ * \brief C++ API: This class encapsulates the per-glyph storage used by the ICU LayoutEngine. >> ++ */ >> ++ >> ++U_NAMESPACE_BEGIN >> ++ >> ++/** >> + * This class encapsulates the per-glyph storage used by the ICU LayoutEngine. >> + * For each glyph it holds the glyph ID, the index of the backing store character >> + * which produced the glyph, the X and Y position of the glyph and an auxillary data >> +@@ -50,7 +56,7 @@ >> + * >> + * @draft ICU 3.6 >> + */ >> +-class U_LAYOUT_API LEGlyphStorage : protected LEInsertionCallback >> ++class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback >> + { >> + private: >> + /** >> +@@ -112,35 +118,37 @@ >> + >> + protected: >> + /** >> +- * This implements LEInsertionCallback. The >> +- * LEInsertionList will call this method once for >> +- * each insertion. >> ++ * This implements LEInsertionCallback. The LEInsertionList >> ++ * will call this method once for each insertion. >> + * >> + * @param atPosition the position of the insertion >> + * @param count the number of glyphs being inserted >> + * @param newGlyphs the address of the new glyph IDs >> + * >> +- * @return true if LEInsertionList >> +- * should stop processing the insertion list after this insertion. >> ++ * @return true if LEInsertionList should stop >> ++ * processing the insertion list after this insertion. >> + * >> + * @see LEInsertionList.h >> + * >> + * @draft ICU 3.0 >> + */ >> +- virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, >> +- LEGlyphID newGlyphs[]); >> ++ virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]); >> + >> + public: >> + >> + /** >> +- * Allocates an empty LEGlyphStorage object. You must >> +- * call allocateGlyphArray, allocatePositions and >> +- * allocateAuxData to allocate the data. >> ++ * Allocates an empty LEGlyphStorage object. You must call >> ++ * allocateGlyphArray, allocatePositions and allocateAuxData >> ++ * to allocate the data. >> ++ * >> ++ * @draft ICU 3.0 >> + */ >> + LEGlyphStorage(); >> + >> + /** >> + * The destructor. This will deallocate all of the arrays. >> ++ * >> ++ * @draft ICU 3.0 >> + */ >> + ~LEGlyphStorage(); >> + >> +@@ -154,9 +162,9 @@ >> + inline le_int32 getGlyphCount() const; >> + >> + /** >> +- * This method copies the glyph array into a caller supplied >> +- * array. The caller must ensure that the array is large enough >> +- * to hold all the glyphs. >> ++ * This method copies the glyph array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold all >> ++ * the glyphs. >> + * >> + * @param glyphs - the destiniation glyph array >> + * @param success - set to an error code if the operation fails >> +@@ -166,10 +174,10 @@ >> + void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the glyph array into a caller supplied >> +- * array, ORing in extra bits. (This functionality is needed by >> +- * the JDK, which uses 32 bits pre glyph idex, with the high 16 >> +- * bits encoding the composite font slot number) >> ++ * This method copies the glyph array into a caller supplied array, >> ++ * ORing in extra bits. (This functionality is needed by the JDK, >> ++ * which uses 32 bits pre glyph idex, with the high 16 bits encoding >> ++ * the composite font slot number) >> + * >> + * @param glyphs - the destination (32 bit) glyph array >> + * @param extraBits - this value will be ORed with each glyph index >> +@@ -177,13 +185,12 @@ >> + * >> + * @draft ICU 3.0 >> + */ >> +- void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, >> +- LEErrorCode &success) const; >> ++ void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the character index array into a caller >> +- * supplied array. The caller must ensure that the array is large >> +- * enough to hold a character index for each glyph. >> ++ * This method copies the character index array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold a >> ++ * character index for each glyph. >> + * >> + * @param charIndices - the destiniation character index array >> + * @param success - set to an error code if the operation fails >> +@@ -193,9 +200,9 @@ >> + void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the character index array into a caller >> +- * supplied array. The caller must ensure that the array is large >> +- * enough to hold a character index for each glyph. >> ++ * This method copies the character index array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold a >> ++ * character index for each glyph. >> + * >> + * @param charIndices - the destiniation character index array >> + * @param indexBase - an offset which will be added to each index >> +@@ -203,14 +210,13 @@ >> + * >> + * @draft ICU 3.0 >> + */ >> +- void getCharIndices(le_int32 charIndices[], le_int32 indexBase, >> +- LEErrorCode &success) const; >> ++ void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the position array into a caller supplied >> +- * array. The caller must ensure that the array is large enough >> +- * to hold an X and Y position for each glyph, plus an extra X and >> +- * Y for the advance of the last glyph. >> ++ * This method copies the position array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold an >> ++ * X and Y position for each glyph, plus an extra X and Y for the >> ++ * advance of the last glyph. >> + * >> + * @param positions - the destiniation position array >> + * @param success - set to an error code if the operation fails >> +@@ -233,33 +239,27 @@ >> + * >> + * @draft ICU 3.0 >> + */ >> +- void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, >> +- LEErrorCode &success) const; >> ++ void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; >> + >> + /** >> +- * This method allocates the glyph array, the char indices array >> +- * and the insertion list. You must call this method before using >> +- * the object. This method also initializes the char indices >> ++ * This method allocates the glyph array, the char indices array and the insertion list. You >> ++ * must call this method before using the object. This method also initializes the char indices >> + * array. >> +- * @param initialGlyphCount the initial size of the glyph and char >> +- * indices arrays. >> +- * @param rightToLeft true if the original input text >> +- * is right to left. >> +- * @param success set to an error code if the storage cannot be >> +- * allocated of if the initial glyph count is not positive. >> ++ * >> ++ * @param initialGlyphCount the initial size of the glyph and char indices arrays. >> ++ * @param rightToLeft true if the original input text is right to left. >> ++ * @param success set to an error code if the storage cannot be allocated of if the initial >> ++ * glyph count is not positive. >> + * >> + * @draft ICU 3.0 >> + */ >> +- void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, >> +- LEErrorCode &success); >> ++ void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success); >> + >> + /** >> +- * This method allocates the storage for the glyph positions. It >> +- * allocates one extra X, Y position pair for the position just >> +- * after the last glyph. >> ++ * This method allocates the storage for the glyph positions. It allocates one extra X, Y >> ++ * position pair for the position just after the last glyph. >> + * >> +- * @param success set to an error code if the positions array >> +- * cannot be allocated. >> ++ * @param success set to an error code if the positions array cannot be allocated. >> + * >> + * @return the number of X, Y position pairs allocated. >> + * >> +@@ -270,8 +270,7 @@ >> + /** >> + * This method allocates the storage for the auxillary glyph data. >> + * >> +- * @param success set to an error code if the aulillary data array >> +- * cannot be allocated. >> ++ * @param success set to an error code if the aulillary data array cannot be allocated. >> + * >> + * @return the size of the auxillary data array. >> + * >> +@@ -282,10 +281,8 @@ >> + /** >> + * Copy the entire auxillary data array. >> + * >> +- * @param auxData the auxillary data array will be copied to this >> +- * address >> +- * @param success set to an error code if the data cannot be >> +- * copied >> ++ * @param auxData the auxillary data array will be copied to this address >> ++ * @param success set to an error code if the data cannot be copied >> + * >> + * @draft ICU 3.6 >> + */ >> +@@ -295,8 +292,7 @@ >> + * Get the glyph ID for a particular glyph. >> + * >> + * @param glyphIndex the index into the glyph array >> +- * @param success set to an error code if the glyph ID cannot be >> +- * retrieved. >> ++ * @param success set to an error code if the glyph ID cannot be retrieved. >> + * >> + * @return the glyph ID >> + * >> +@@ -308,8 +304,7 @@ >> + * Get the char index for a particular glyph. >> + * >> + * @param glyphIndex the index into the glyph array >> +- * @param success set to an error code if the char index cannot be >> +- * retrieved. >> ++ * @param success set to an error code if the char index cannot be retrieved. >> + * >> + * @return the character index >> + * >> +@@ -322,8 +317,7 @@ >> + * Get the auxillary data for a particular glyph. >> + * >> + * @param glyphIndex the index into the glyph array >> +- * @param success set to an error code if the auxillary data >> +- * cannot be retrieved. >> ++ * @param success set to an error code if the auxillary data cannot be retrieved. >> + * >> + * @return the auxillary data >> + * >> +@@ -345,11 +339,10 @@ >> + >> + /** >> + * Call this method to replace a single glyph in the glyph array >> +- * with multiple glyphs. This method uses the >> +- * LEInsertionList to do the insertion. It returns >> +- * the address of storage where the new glyph IDs can be >> +- * stored. They will not actually be inserted into the glyph array >> +- * until applyInsertions is called. >> ++ * with multiple glyphs. This method uses the LEInsertionList >> ++ * to do the insertion. It returns the address of storage where the new >> ++ * glyph IDs can be stored. They will not actually be inserted into the >> ++ * glyph array until applyInsertions is called. >> + * >> + * @param atIndex the index of the glyph to be replaced >> + * @param insertCount the number of glyphs to replace it with >> +@@ -381,26 +374,22 @@ >> + * >> + * @param glyphIndex the index of the glyph >> + * @param glyphID the new glyph ID >> +- * @param success will be set to an error code if the glyph ID >> +- * cannot be set. >> ++ * @param success will be set to an error code if the glyph ID cannot be set. >> + * >> + * @draft ICU 3.0 >> + */ >> +- void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, >> +- LEErrorCode &success); >> ++ void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success); >> + >> + /** >> + * Set the char index for a particular glyph. >> + * >> + * @param glyphIndex the index of the glyph >> + * @param charIndex the new char index >> +- * @param success will be set to an error code if the char index >> +- * cannot be set. >> ++ * @param success will be set to an error code if the char index cannot be set. >> + * >> + * @draft ICU 3.0 >> + */ >> +- void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, >> +- LEErrorCode &success); >> ++ void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success); >> + >> + /** >> + * Set the X, Y position for a particular glyph. >> +@@ -408,13 +397,11 @@ >> + * @param glyphIndex the index of the glyph >> + * @param x the new X position >> + * @param y the new Y position >> +- * @param success will be set to an error code if the position >> +- * cannot be set. >> ++ * @param success will be set to an error code if the position cannot be set. >> + * >> + * @draft ICU 3.0 >> + */ >> +- void setPosition(le_int32 glyphIndex, float x, float y, >> +- LEErrorCode &success); >> ++ void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success); >> + >> + /** >> + * Adjust the X, Y position for a particular glyph. >> +@@ -422,21 +409,18 @@ >> + * @param glyphIndex the index of the glyph >> + * @param xAdjust the adjustment to the glyph's X position >> + * @param yAdjust the adjustment to the glyph's Y position >> +- * @param success will be set to an error code if the glyph's >> +- * position cannot be adjusted. >> ++ * @param success will be set to an error code if the glyph's position cannot be adjusted. >> + * >> + * @draft ICU 3.0 >> + */ >> +- void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, >> +- LEErrorCode &success); >> ++ void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success); >> + >> + /** >> + * Set the auxillary data for a particular glyph. >> + * >> + * @param glyphIndex the index of the glyph >> + * @param auxData the new auxillary data >> +- * @param success will be set to an error code if the auxillary >> +- * data cannot be set. >> ++ * @param success will be set to an error code if the auxillary data cannot be set. >> + * >> + * @draft ICU 3.6 >> + */ >> +@@ -511,14 +495,28 @@ >> + void adoptGlyphCount(le_int32 newGlyphCount); >> + >> + /** >> +- * This method frees the glyph, character index, position and >> +- * auxillary data arrays so that the LayoutEngine can be reused to >> +- * layout a different characer array. (This method is also called >> ++ * This method frees the glyph, character index, position and >> ++ * auxillary data arrays so that the LayoutEngine can be reused >> ++ * to layout a different characer array. (This method is also called >> + * by the destructor) >> + * >> + * @draft ICU 3.0 >> + */ >> + void reset(); >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @draft ICU 3.0 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @draft ICU 3.0 >> ++ */ >> ++ static UClassID getStaticClassID(); >> + }; >> + >> + inline le_int32 LEGlyphStorage::getGlyphCount() const >> +@@ -531,4 +529,7 @@ >> + return fGlyphs[glyphIndex]; >> + } >> + >> ++ >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEInsertionList.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEInsertionList.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + ********************************************************************** >> + * Copyright (C) 1998-2004, International Business Machines >> + * Corporation and others. All Rights Reserved. >> +@@ -34,6 +33,8 @@ >> + #include "LETypes.h" >> + #include "LEInsertionList.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define ANY_NUMBER 1 >> + >> + struct InsertionRecord >> +@@ -44,6 +45,8 @@ >> + LEGlyphID glyphs[ANY_NUMBER]; >> + }; >> + >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LEInsertionList) >> ++ >> + LEInsertionList::LEInsertionList(le_bool rightToLeft) >> + : head(NULL), tail(NULL), growAmount(0), append(rightToLeft) >> + { >> +@@ -106,3 +109,5 @@ >> + >> + return FALSE; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEInsertionList.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEInsertionList.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEInsertionList.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -24,7 +24,6 @@ >> + */ >> + >> + /* >> +- * >> + ********************************************************************** >> + * Copyright (C) 1998-2004, International Business Machines >> + * Corporation and others. All Rights Reserved. >> +@@ -36,6 +35,8 @@ >> + >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct InsertionRecord; >> + >> + /** >> +@@ -78,7 +79,7 @@ >> + * >> + * @internal >> + */ >> +-class LEInsertionList >> ++class LEInsertionList : public UObject >> + { >> + public: >> + /** >> +@@ -140,6 +141,20 @@ >> + */ >> + void reset(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + >> + /** >> +@@ -174,4 +189,6 @@ >> + le_bool append; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LELanguages.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LELanguages.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LELanguages.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,10 +25,12 @@ >> + >> + /* >> + * >> +- * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. >> ++ * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. >> + * >> + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS >> + * YOU REALLY KNOW WHAT YOU'RE DOING. >> ++ * >> ++ * Generated on: 07/19/2005 01:01:08 PM PDT >> + */ >> + >> + #ifndef __LELANGUAGES_H >> +@@ -37,11 +39,18 @@ >> + #include "LETypes.h" >> + >> + /** >> ++ * \file >> ++ * \brief C++ API: List of language codes for LayoutEngine >> ++ */ >> ++ >> ++U_NAMESPACE_BEGIN >> ++ >> ++/** >> + * A provisional list of language codes. For now, >> + * this is just a list of languages which the LayoutEngine >> + * supports. >> + * >> +- * @draft ICU 3.0 >> ++ * @draft ICU 3.4 >> + */ >> + >> + enum LanguageCodes { >> +@@ -79,4 +88,5 @@ >> + languageCodeCount = 30 >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEScripts.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LEScripts.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEScripts.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,17 +25,23 @@ >> + >> + /* >> + * >> +- * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved. >> ++ * (C) Copyright IBM Corp. 1998-2005. All Rights Reserved. >> + * >> + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS >> + * YOU REALLY KNOW WHAT YOU'RE DOING. >> +- * >> + */ >> + >> + #ifndef __LESCRIPTS_H >> + #define __LESCRIPTS_H >> + >> + #include "LETypes.h" >> ++/** >> ++ * \file >> ++ * \brief C++ API: Constants for Unicode script values >> ++ */ >> ++ >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + /** >> + * Constants for Unicode script values, generated using >> +@@ -104,4 +110,5 @@ >> + scriptCodeCount = 55 >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LEStandalone.h >> +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LEStandalone.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -0,0 +1,132 @@ >> ++/* >> ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> ++ * >> ++ * This code is free software; you can redistribute it and/or modify it >> ++ * under the terms of the GNU General Public License version 2 only, as >> ++ * published by the Free Software Foundation. Sun designates this >> ++ * particular file as subject to the "Classpath" exception as provided >> ++ * by Sun in the LICENSE file that accompanied this code. >> ++ * >> ++ * This code 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 >> ++ * version 2 for more details (a copy is included in the LICENSE file that >> ++ * accompanied this code). >> ++ * >> ++ * You should have received a copy of the GNU General Public License version >> ++ * 2 along with this work; if not, write to the Free Software Foundation, >> ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. >> ++ * >> ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, >> ++ * CA 95054 USA or visit www.sun.com if you need additional information or >> ++ * have any questions. >> ++ * >> ++ */ >> ++ >> ++#ifndef __LESTANDALONE >> ++#define __LESTANDALONE >> ++ >> ++/* Definitions to make Layout Engine work away from ICU. */ >> ++#ifndef U_NAMESPACE_BEGIN >> ++#define U_NAMESPACE_BEGIN >> ++#endif >> ++ >> ++#ifndef U_NAMESPACE_END >> ++#define U_NAMESPACE_END >> ++#endif >> ++ >> ++/* RTTI Definition */ >> ++typedef const char *UClassID; >> ++#ifndef UOBJECT_DEFINE_RTTI_IMPLEMENTATION >> ++#define UOBJECT_DEFINE_RTTI_IMPLEMENTATION(x) UClassID x::getStaticClassID(){static char z=0; return (UClassID)&z; } UClassID x::getDynamicClassID() const{return x::getStaticClassID(); } >> ++#endif >> ++ >> ++/* UMemory's functions aren't used by the layout engine. */ >> ++struct UMemory {}; >> ++/* UObject's functions aren't used by the layout engine. */ >> ++struct UObject {}; >> ++ >> ++/* String handling */ >> ++#include >> ++#include >> ++ >> ++/** >> ++ * A convenience macro to test for the success of a LayoutEngine call. >> ++ * >> ++ * @stable ICU 2.4 >> ++ */ >> ++#define LE_SUCCESS(code) ((code)<=LE_NO_ERROR) >> ++ >> ++/** >> ++ * A convenience macro to test for the failure of a LayoutEngine call. >> ++ * >> ++ * @stable ICU 2.4 >> ++ */ >> ++#define LE_FAILURE(code) ((code)>LE_NO_ERROR) >> ++ >> ++ >> ++#ifndef _LP64 >> ++typedef long le_int32; >> ++typedef unsigned long le_uint32; >> ++#else >> ++typedef int le_int32; >> ++typedef unsigned int le_uint32; >> ++#endif >> ++ >> ++#define HAVE_LE_INT32 1 >> ++#define HAVE_LE_UINT32 1 >> ++ >> ++typedef unsigned short UChar; >> ++typedef le_uint32 UChar32; >> ++ >> ++typedef short le_int16; >> ++#define HAVE_LE_INT16 1 >> ++ >> ++typedef unsigned short le_uint16; >> ++#define HAVE_LE_UINT16 >> ++ >> ++typedef signed char le_int8; >> ++#define HAVE_LE_INT8 >> ++ >> ++typedef unsigned char le_uint8; >> ++#define HAVE_LE_UINT8 >> ++ >> ++typedef char UBool; >> ++ >> ++/** >> ++ * Error codes returned by the LayoutEngine. >> ++ * >> ++ * @stable ICU 2.4 >> ++ */ >> ++enum LEErrorCode { >> ++ /* informational */ >> ++ LE_NO_SUBFONT_WARNING = -127, // U_USING_DEFAULT_WARNING, >> ++ >> ++ /* success */ >> ++ LE_NO_ERROR = 0, // U_ZERO_ERROR, >> ++ >> ++ /* failures */ >> ++ LE_ILLEGAL_ARGUMENT_ERROR = 1, // U_ILLEGAL_ARGUMENT_ERROR, >> ++ LE_MEMORY_ALLOCATION_ERROR = 7, // U_MEMORY_ALLOCATION_ERROR, >> ++ LE_INDEX_OUT_OF_BOUNDS_ERROR = 8, //U_INDEX_OUTOFBOUNDS_ERROR, >> ++ LE_NO_LAYOUT_ERROR = 16, // U_UNSUPPORTED_ERROR, >> ++ LE_INTERNAL_ERROR = 5, // U_INTERNAL_PROGRAM_ERROR, >> ++ LE_FONT_FILE_NOT_FOUND_ERROR = 4, // U_FILE_ACCESS_ERROR, >> ++ LE_MISSING_FONT_TABLE_ERROR = 2 // U_MISSING_RESOURCE_ERROR >> ++}; >> ++#define HAVE_LEERRORCODE >> ++ >> ++#define U_LAYOUT_API >> ++ >> ++#define uprv_malloc malloc >> ++#define uprv_free free >> ++#define uprv_memcpy memcpy >> ++#define uprv_realloc realloc >> ++ >> ++#if !defined(U_IS_BIG_ENDIAN) >> ++ #ifdef _LITTLE_ENDIAN >> ++ #define U_IS_BIG_ENDIAN 0 >> ++ #endif >> ++#endif >> ++ >> ++#endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LESwaps.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LESwaps.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LESwaps.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -26,7 +26,7 @@ >> + >> + /* >> + * >> +- * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved >> ++ * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> + >> +@@ -35,11 +35,12 @@ >> + >> + #include "LETypes.h" >> + >> +-#if !defined(U_IS_BIG_ENDIAN) >> +- #ifdef _LITTLE_ENDIAN >> +- #define U_IS_BIG_ENDIAN 0 >> +- #endif >> +-#endif >> ++/** >> ++ * \file >> ++ * \brief C++ API: Endian independent access to data for LayoutEngine >> ++ */ >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + /** >> + * A convenience macro which invokes the swapWord member function >> +@@ -47,7 +48,6 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- >> + #if defined(U_IS_BIG_ENDIAN) >> + #if U_IS_BIG_ENDIAN >> + #define SWAPW(value) (value) >> +@@ -64,7 +64,6 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- >> + #if defined(U_IS_BIG_ENDIAN) >> + #if U_IS_BIG_ENDIAN >> + #define SWAPL(value) (value) >> +@@ -86,8 +85,7 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +-class LESwaps >> +-{ >> ++class U_LAYOUT_API LESwaps /* not : public UObject because all methods are static */ { >> + public: >> + >> + #if !defined(U_IS_BIG_ENDIAN) >> +@@ -144,4 +142,5 @@ >> + LESwaps() {} // private - forbid instantiation >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LETypes.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LETypes.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LETypes.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,7 +23,6 @@ >> + * >> + */ >> + >> +- >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> +@@ -33,74 +32,98 @@ >> + #ifndef __LETYPES_H >> + #define __LETYPES_H >> + >> +-#define LE_USE_CMEMORY >> +- >> +-#ifdef LE_USE_CMEMORY >> +-#include >> +-#include >> ++/** >> ++ * If LE_Standalone is defined, it must exist and contain >> ++ * definitions for some core ICU defines. >> ++ */ >> ++#ifdef LE_STANDALONE >> ++#include "LEStandalone.h" >> + #endif >> + >> +-#ifndef _LP64 >> +-typedef long le_int32; >> +-typedef unsigned long le_uint32; >> ++#ifdef LE_STANDALONE >> ++/* Stand-alone Layout Engine- without ICU. */ >> ++#include "LEStandalone.h" >> ++#define LE_USE_CMEMORY >> + #else >> +-typedef int le_int32; >> +-typedef unsigned int le_uint32; >> ++#if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined(U_COMBINED_IMPLEMENTATION)) >> ++#define LE_USE_CMEMORY >> + #endif >> + >> +-typedef short le_int16; >> +-typedef unsigned short le_uint16; >> +-typedef signed char le_int8; >> +-typedef unsigned char le_uint8; >> +-typedef char le_bool; >> ++#include "unicode/utypes.h" >> ++#include "unicode/uobject.h" >> ++#ifdef LE_USE_CMEMORY >> ++#include "cmemory.h" >> ++#endif >> ++#endif /* not standalone */ >> + >> +-typedef char UClassID; >> + >> +-#if 0 >> ++U_NAMESPACE_BEGIN >> ++ >> ++/*! >> ++ * \file >> ++ * \brief Basic definitions for the ICU LayoutEngine >> ++ */ >> ++ >> + /** >> + * A type used for signed, 32-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> ++#ifndef HAVE_LE_INT32 >> + typedef int32_t le_int32; >> ++#endif >> + >> + /** >> + * A type used for unsigned, 32-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> ++#ifndef HAVE_LE_UINT32 >> + typedef uint32_t le_uint32; >> ++#endif >> + >> + /** >> + * A type used for signed, 16-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> ++#ifndef HAVE_LE_INT16 >> + typedef int16_t le_int16; >> ++#endif >> + >> ++#ifndef HAVE_LE_UINT16 >> + /** >> + * A type used for unsigned, 16-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> + typedef uint16_t le_uint16; >> ++#endif >> + >> ++#ifndef HAVE_LE_INT8 >> + /** >> + * A type used for signed, 8-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> + typedef int8_t le_int8; >> ++#endif >> + >> ++#ifndef HAVE_LE_UINT8 >> + /** >> + * A type used for unsigned, 8-bit integers. >> + * >> + * @stable ICU 2.4 >> + */ >> + typedef uint8_t le_uint8; >> ++#endif >> + >> +-typedef char le_bool; >> +-#endif >> ++/** >> ++* A type used for boolean values. >> ++* >> ++* @stable ICU 2.4 >> ++*/ >> ++typedef UBool le_bool; >> + >> + #ifndef TRUE >> + /** >> +@@ -264,21 +287,21 @@ >> + * >> + * @stable ICU 2.4 >> + */ >> +-typedef le_uint16 LEUnicode16; >> ++typedef UChar LEUnicode16; >> + >> + /** >> + * Used to represent 32-bit Unicode code points. >> + * >> + * @stable ICU 2.4 >> + */ >> +-typedef le_uint32 LEUnicode32; >> ++typedef UChar32 LEUnicode32; >> + >> + /** >> + * Used to represent 16-bit Unicode code points. >> + * >> + * @deprecated since ICU 2.4. Use LEUnicode16 instead >> + */ >> +-typedef le_uint16 LEUnicode; >> ++typedef UChar LEUnicode; >> + >> + /** >> + * Used to hold a pair of (x, y) values which represent a point. >> +@@ -325,7 +348,7 @@ >> + * >> + * @internal >> + */ >> +-#define LE_ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0]) >> ++#define LE_ARRAY_COPY(dst, src, count) uprv_memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0]) >> + >> + /** >> + * Allocate an array of basic types. This is used to isolate the rest of >> +@@ -333,7 +356,7 @@ >> + * >> + * @internal >> + */ >> +-#define LE_NEW_ARRAY(type, count) (type *) malloc((count) * sizeof(type)) >> ++#define LE_NEW_ARRAY(type, count) (type *) uprv_malloc((count) * sizeof(type)) >> + >> + /** >> + * Re-allocate an array of basic types. This is used to isolate the rest of >> +@@ -341,7 +364,7 @@ >> + * >> + * @internal >> + */ >> +-#define LE_GROW_ARRAY(array, newSize) realloc((void *) (array), (newSize) * sizeof (array)[0]) >> ++#define LE_GROW_ARRAY(array, newSize) uprv_realloc((void *) (array), (newSize) * sizeof (array)[0]) >> + >> + /** >> + * Free an array of basic types. This is used to isolate the rest of >> +@@ -349,7 +372,7 @@ >> + * >> + * @internal >> + */ >> +-#define LE_DELETE_ARRAY(array) free((void *) (array)) >> ++#define LE_DELETE_ARRAY(array) uprv_free((void *) (array)) >> + #endif >> + >> + /** >> +@@ -567,22 +590,24 @@ >> + * >> + * @stable ICU 2.4 >> + */ >> ++#ifndef HAVE_LEERRORCODE >> + enum LEErrorCode { >> + /* informational */ >> +- LE_NO_SUBFONT_WARNING = -127, // U_USING_DEFAULT_WARNING, >> ++ LE_NO_SUBFONT_WARNING = U_USING_DEFAULT_WARNING, /**< The font does not contain subfonts. */ >> + >> + /* success */ >> +- LE_NO_ERROR = 0, // U_ZERO_ERROR, >> ++ LE_NO_ERROR = U_ZERO_ERROR, /**< No error, no warning. */ >> + >> + /* failures */ >> +- LE_ILLEGAL_ARGUMENT_ERROR = 1, // U_ILLEGAL_ARGUMENT_ERROR, >> +- LE_MEMORY_ALLOCATION_ERROR = 7, // U_MEMORY_ALLOCATION_ERROR, >> +- LE_INDEX_OUT_OF_BOUNDS_ERROR = 8, //U_INDEX_OUTOFBOUNDS_ERROR, >> +- LE_NO_LAYOUT_ERROR = 16, // U_UNSUPPORTED_ERROR, >> +- LE_INTERNAL_ERROR = 5, // U_INTERNAL_PROGRAM_ERROR, >> +- LE_FONT_FILE_NOT_FOUND_ERROR = 4, // U_FILE_ACCESS_ERROR, >> +- LE_MISSING_FONT_TABLE_ERROR = 2 // U_MISSING_RESOURCE_ERROR >> ++ LE_ILLEGAL_ARGUMENT_ERROR = U_ILLEGAL_ARGUMENT_ERROR, /**< An illegal argument was detected. */ >> ++ LE_MEMORY_ALLOCATION_ERROR = U_MEMORY_ALLOCATION_ERROR, /**< Memory allocation error. */ >> ++ LE_INDEX_OUT_OF_BOUNDS_ERROR = U_INDEX_OUTOFBOUNDS_ERROR, /**< Trying to access an index that is out of bounds. */ >> ++ LE_NO_LAYOUT_ERROR = U_UNSUPPORTED_ERROR, /**< You must call layoutChars() first. */ >> ++ LE_INTERNAL_ERROR = U_INTERNAL_PROGRAM_ERROR, /**< An internal error was encountered. */ >> ++ LE_FONT_FILE_NOT_FOUND_ERROR = U_FILE_ACCESS_ERROR, /**< The requested font file cannot be opened. */ >> ++ LE_MISSING_FONT_TABLE_ERROR = U_MISSING_RESOURCE_ERROR /**< The requested font table does not exist. */ >> + }; >> ++#endif >> + >> + #ifndef XP_CPLUSPLUS >> + /** >> +@@ -598,14 +623,20 @@ >> + * >> + * @stable ICU 2.4 >> + */ >> +-#define LE_SUCCESS(code) ((code)<=LE_NO_ERROR) >> ++#ifndef LE_FAILURE >> ++#define LE_SUCCESS(code) (U_SUCCESS((UErrorCode)code)) >> ++#endif >> + >> + /** >> + * A convenience macro to test for the failure of a LayoutEngine call. >> + * >> + * @stable ICU 2.4 >> + */ >> +-#define LE_FAILURE(code) ((code)>LE_NO_ERROR) >> ++#ifndef LE_FAILURE >> ++#define LE_FAILURE(code) (U_FAILURE((UErrorCode)code)) >> ++#endif >> + >> +-#define U_LAYOUT_API >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,6 +23,7 @@ >> + * >> + */ >> + >> ++ >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> +@@ -40,6 +41,7 @@ >> + #include "IndicLayoutEngine.h" >> + #include "KhmerLayoutEngine.h" >> + #include "ThaiLayoutEngine.h" >> ++//#include "TibetanLayoutEngine.h" >> + #include "GXLayoutEngine.h" >> + #include "ScriptAndLanguageTags.h" >> + #include "CharSubstitutionFilter.h" >> +@@ -55,6 +57,8 @@ >> + >> + #include "KernTable.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const LEUnicode32 DefaultCharMapper::controlChars[] = { >> + 0x0009, 0x000A, 0x000D, >> + /*0x200C, 0x200D,*/ 0x200E, 0x200F, >> +@@ -101,9 +105,7 @@ >> + } >> + >> + if (fMirror) { >> +- le_int32 index = OpenTypeUtilities::search((le_uint32) ch, >> +- (le_uint32 *)DefaultCharMapper::mirroredChars, >> +- DefaultCharMapper::mirroredCharsCount); >> ++ le_int32 index = OpenTypeUtilities::search((le_uint32) ch, (le_uint32 *)DefaultCharMapper::mirroredChars, DefaultCharMapper::mirroredCharsCount); >> + >> + if (mirroredChars[index] == ch) { >> + return DefaultCharMapper::srahCderorrim[index]; >> +@@ -132,6 +134,9 @@ >> + // nothing to do >> + } >> + >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LayoutEngine) >> ++ >> + #define ccmpFeatureTag LE_CCMP_FEATURE_TAG >> + >> + #define ccmpFeatureMask 0x80000000UL >> +@@ -145,10 +150,9 @@ >> + >> + static const le_int32 canonFeatureMapCount = LE_ARRAY_SIZE(canonFeatureMap); >> + >> +-LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, le_int32 typoFlags) >> +- : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), >> +- fLanguageCode(languageCode), fTypoFlags(typoFlags) >> ++LayoutEngine::LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++ : fGlyphStorage(NULL), fFontInstance(fontInstance), fScriptCode(scriptCode), fLanguageCode(languageCode), >> ++ fTypoFlags(typoFlags) >> + { >> + fGlyphStorage = new LEGlyphStorage(); >> + } >> +@@ -158,8 +162,7 @@ >> + return fGlyphStorage->getGlyphCount(); >> + } >> + >> +-void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, >> +- LEErrorCode &success) const >> ++void LayoutEngine::getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const >> + { >> + fGlyphStorage->getCharIndices(charIndices, indexBase, success); >> + } >> +@@ -170,8 +173,7 @@ >> + } >> + >> + // Copy the glyphs into caller's (32-bit) glyph array, OR in extraBits >> +-void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, >> +- LEErrorCode &success) const >> ++void LayoutEngine::getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const >> + { >> + fGlyphStorage->getGlyphs(glyphs, extraBits, success); >> + } >> +@@ -218,15 +220,13 @@ >> + fGlyphStorage->getGlyphPositions(positions, success); >> + } >> + >> +-void LayoutEngine::getGlyphPosition(le_int32 glyphIndex, float &x, float &y, >> +- LEErrorCode &success) const >> ++void LayoutEngine::getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const >> + { >> + fGlyphStorage->getGlyphPosition(glyphIndex, x, y, success); >> + } >> + >> +-le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, LEUnicode *&outChars, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -237,12 +237,7 @@ >> + return 0; >> + } >> + >> +- if ((fTypoFlags & 0x4) == 0) { // no canonical processing >> +- return count; >> +- } >> +- >> +- const GlyphSubstitutionTableHeader *canonGSUBTable = >> +- (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; >> ++ const GlyphSubstitutionTableHeader *canonGSUBTable = (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable; >> + LETag scriptTag = OpenTypeLayoutEngine::getScriptTag(fScriptCode); >> + LETag langSysTag = OpenTypeLayoutEngine::getLangSysTag(fLanguageCode); >> + le_int32 i, dir = 1, out = 0, outCharCount = count; >> +@@ -256,16 +251,15 @@ >> + // We could just do the mark reordering for all scripts, but most >> + // of them probably don't need it... >> + if (fScriptCode == hebrScriptCode) { >> +- reordered = LE_NEW_ARRAY(LEUnicode, count); >> ++ reordered = LE_NEW_ARRAY(LEUnicode, count); >> + >> +- if (reordered == NULL) { >> +- success = LE_MEMORY_ALLOCATION_ERROR; >> +- return 0; >> +- } >> ++ if (reordered == NULL) { >> ++ success = LE_MEMORY_ALLOCATION_ERROR; >> ++ return 0; >> ++ } >> + >> +- CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, >> +- reordered, glyphStorage); >> +- inChars = reordered; >> ++ CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, glyphStorage); >> ++ inChars = reordered; >> + } >> + >> + glyphStorage.allocateGlyphArray(count, rightToLeft, success); >> +@@ -289,8 +283,7 @@ >> + LE_DELETE_ARRAY(reordered); >> + } >> + >> +- outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, >> +- langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE); >> ++ outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, canonFeatureMap, canonFeatureMapCount, FALSE); >> + >> + out = (rightToLeft? count - 1 : 0); >> + >> +@@ -305,35 +298,26 @@ >> + return outCharCount; >> + } >> + >> +- >> +-le_int32 LayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 LayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || >> +- offset + count > max) { >> +- >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> + >> + LEUnicode *outChars = NULL; >> +- le_int32 outCharCount = characterProcessing(chars, offset, count, max, >> +- rightToLeft, outChars, glyphStorage, success); >> ++ le_int32 outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success); >> + >> + if (outChars != NULL) { >> +- mapCharsToGlyphs(outChars, 0, outCharCount, rightToLeft, rightToLeft, >> +- glyphStorage, success); >> +- // FIXME: a subclass may have allocated this, in which case this delete >> +- // might not work... >> +- LE_DELETE_ARRAY(outChars); >> ++ mapCharsToGlyphs(outChars, 0, outCharCount, rightToLeft, rightToLeft, glyphStorage, success); >> ++ LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... >> + } else { >> +- mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, >> +- glyphStorage, success); >> ++ mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, glyphStorage, success); >> + } >> + >> + return glyphStorage.getGlyphCount(); >> +@@ -341,8 +325,7 @@ >> + >> + // Input: glyphs >> + // Output: positions >> +-void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, >> +- float x, float y, LEErrorCode &success) >> ++void LayoutEngine::positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -369,9 +352,8 @@ >> + glyphStorage.setPosition(glyphCount, x, y, success); >> + } >> + >> +-void LayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void LayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -398,8 +380,7 @@ >> + return; >> + } >> + >> +-void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, >> +- LEGlyphFilter *markFilter, LEErrorCode &success) >> ++void LayoutEngine::adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success) >> + { >> + float xAdjust = 0; >> + le_int32 p, glyphCount = glyphStorage.getGlyphCount(); >> +@@ -435,9 +416,7 @@ >> + glyphStorage.adjustPosition(glyphCount, xAdjust, 0, success); >> + } >> + >> +-void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, >> +- le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, >> +- LEErrorCode &success) >> ++void LayoutEngine::adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success) >> + { >> + float xAdjust = 0; >> + le_int32 c = 0, direction = 1, p; >> +@@ -484,9 +463,8 @@ >> + return fFontInstance->getFontTable(tableTag); >> + } >> + >> +-void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, le_bool mirror, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void LayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -496,32 +474,27 @@ >> + >> + DefaultCharMapper charMapper(TRUE, mirror); >> + >> +- fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, >> +- &charMapper, glyphStorage); >> ++ fFontInstance->mapCharsToGlyphs(chars, offset, count, reverse, &charMapper, glyphStorage); >> + } >> + >> + // Input: characters, font? >> + // Output: glyphs, positions, char indices >> + // Returns: number of glyphs >> +-le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- float x, float y, LEErrorCode &success) >> ++le_int32 LayoutEngine::layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ float x, float y, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || >> +- offset + count > max) { >> +- >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> + >> + le_int32 glyphCount; >> + >> +- glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, >> +- *fGlyphStorage, success); >> ++ glyphCount = computeGlyphs(chars, offset, count, max, rightToLeft, *fGlyphStorage, success); >> + positionGlyphs(*fGlyphStorage, x, y, success); >> + adjustGlyphPositions(chars, offset, count, rightToLeft, *fGlyphStorage, success); >> + >> +@@ -533,17 +506,13 @@ >> + fGlyphStorage->reset(); >> + } >> + >> +-LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success) >> ++LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success) >> + { >> + // 3 -> kerning and ligatures >> +- return LayoutEngine::layoutEngineFactory(fontInstance, scriptCode, >> +- languageCode, 3, success); >> ++ return LayoutEngine::layoutEngineFactory(fontInstance, scriptCode, languageCode, 3, success); >> + } >> + >> +-LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- LEErrorCode &success) >> ++LayoutEngine *LayoutEngine::layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success) >> + { >> + static const le_uint32 gsubTableTag = LE_GSUB_TABLE_TAG; >> + static const le_uint32 mortTableTag = LE_MORT_TABLE_TAG; >> +@@ -552,18 +521,12 @@ >> + return NULL; >> + } >> + >> +- // code2000 has GPOS kern feature tags for latn script >> +- >> +- const GlyphSubstitutionTableHeader *gsubTable = >> +- (const GlyphSubstitutionTableHeader *) fontInstance->getFontTable(gsubTableTag); >> ++ const GlyphSubstitutionTableHeader *gsubTable = (const GlyphSubstitutionTableHeader *) fontInstance->getFontTable(gsubTableTag); >> + LayoutEngine *result = NULL; >> + LETag scriptTag = 0x00000000; >> + LETag languageTag = 0x00000000; >> + >> +- if (gsubTable != NULL && >> +- gsubTable->coversScript(scriptTag = >> +- OpenTypeLayoutEngine::getScriptTag(scriptCode))) { >> +- >> ++ if (gsubTable != NULL && gsubTable->coversScript(scriptTag = OpenTypeLayoutEngine::getScriptTag(scriptCode))) { >> + switch (scriptCode) { >> + case bengScriptCode: >> + case devaScriptCode: >> +@@ -575,13 +538,11 @@ >> + case tamlScriptCode: >> + case teluScriptCode: >> + case sinhScriptCode: >> +- result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + >> + case arabScriptCode: >> +- result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + >> + case haniScriptCode: >> +@@ -593,33 +554,33 @@ >> + case zhtLanguageCode: >> + case zhsLanguageCode: >> + if (gsubTable->coversScriptAndLanguage(scriptTag, languageTag, TRUE)) { >> +- result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new HanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + } >> + >> + // note: falling through to default case. >> + default: >> +- result = new OpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + } >> + >> + break; >> ++#if 0 >> ++ case tibtScriptCode: >> ++ result = new TibetanOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> ++ break; >> ++#endif >> + >> + case khmrScriptCode: >> +- result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new KhmerOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + >> + default: >> +- result = new OpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags, gsubTable); >> ++ result = new OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable); >> + break; >> + } >> + } else { >> +- const MorphTableHeader *morphTable = >> +- (MorphTableHeader *) fontInstance->getFontTable(mortTableTag); >> ++ const MorphTableHeader *morphTable = (MorphTableHeader *) fontInstance->getFontTable(mortTableTag); >> + >> + if (morphTable != NULL) { >> + result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, morphTable); >> +@@ -636,16 +597,18 @@ >> + case teluScriptCode: >> + case sinhScriptCode: >> + { >> +- result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags); >> ++ result = new IndicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); >> + break; >> + } >> + >> + case arabScriptCode: >> +- result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, >> +- languageCode, typoFlags); >> ++ //case hebrScriptCode: >> ++ result = new UnicodeArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); >> + break; >> + >> ++ //case hebrScriptCode: >> ++ // return new HebrewOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); >> ++ >> + case thaiScriptCode: >> + result = new ThaiLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags); >> + break; >> +@@ -667,3 +630,5 @@ >> + LayoutEngine::~LayoutEngine() { >> + delete fGlyphStorage; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,6 +23,7 @@ >> + * >> + */ >> + >> ++ >> + /* >> + * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> +@@ -34,63 +35,61 @@ >> + >> + #include "LETypes.h" >> + >> +-#include >> ++/** >> ++ * \file >> ++ * \brief C++ API: Virtual base class for complex text layout. >> ++ */ >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + class LEFontInstance; >> + class LEGlyphFilter; >> + class LEGlyphStorage; >> + >> + /** >> +- * This is a virtual base class used to do complex text layout. The >> +- * text must all be in a single font, script, and language. An >> +- * instance of a LayoutEngine can be created by calling the >> +- * layoutEngineFactory method. Fonts are identified by instances of >> +- * the LEFontInstance class. Script and language codes are identified >> ++ * This is a virtual base class used to do complex text layout. The text must all >> ++ * be in a single font, script, and language. An instance of a LayoutEngine can be >> ++ * created by calling the layoutEngineFactory method. Fonts are identified by >> ++ * instances of the LEFontInstance class. Script and language codes are identified >> + * by integer codes, which are defined in ScriptAndLanuageTags.h. >> + * >> +- * Note that this class is not public API. It is declared public so >> +- * that it can be exported from the library that it is a part of. >> ++ * Note that this class is not public API. It is declared public so that it can be >> ++ * exported from the library that it is a part of. >> + * >> +- * The input to the layout process is an array of characters in >> +- * logical order, and a starting X, Y position for the text. The >> +- * output is an array of glyph indices, an array of character indices >> +- * for the glyphs, and an array of glyph positions. These arrays are >> +- * protected members of LayoutEngine which can be retreived by a >> +- * public method. The reset method can be called to free these arrays >> +- * so that the LayoutEngine can be reused. >> ++ * The input to the layout process is an array of characters in logical order, >> ++ * and a starting X, Y position for the text. The output is an array of glyph indices, >> ++ * an array of character indices for the glyphs, and an array of glyph positions. >> ++ * These arrays are protected members of LayoutEngine which can be retreived by a >> ++ * public method. The reset method can be called to free these arrays so that the >> ++ * LayoutEngine can be reused. >> + * >> +- * The layout process is done in three steps. There is a protected >> +- * virtual method for each step. These methods have a default >> +- * implementation which only does character to glyph mapping and >> +- * default positioning using the glyph's advance widths. Subclasses >> +- * can override these methods for more advanced layout. There is a >> +- * public method which invokes the steps in the correct order. >> ++ * The layout process is done in three steps. There is a protected virtual method >> ++ * for each step. These methods have a default implementation which only does >> ++ * character to glyph mapping and default positioning using the glyph's advance >> ++ * widths. Subclasses can override these methods for more advanced layout. >> ++ * There is a public method which invokes the steps in the correct order. >> + * >> + * The steps are: >> + * >> +- * 1) Glyph processing - character to glyph mapping and any other >> +- * glyph processing such as ligature substitution and contextual >> +- * forms. >> ++ * 1) Glyph processing - character to glyph mapping and any other glyph processing >> ++ * such as ligature substitution and contextual forms. >> + * >> +- * 2) Glyph positioning - position the glyphs based on their advance >> +- * widths. >> ++ * 2) Glyph positioning - position the glyphs based on their advance widths. >> + * >> +- * 3) Glyph position adjustments - adjustment of glyph positions for >> +- * kerning, accent placement, etc. >> ++ * 3) Glyph position adjustments - adjustment of glyph positions for kerning, >> ++ * accent placement, etc. >> + * >> +- * NOTE: in all methods below, output parameters are references to >> +- * pointers so the method can allocate and free the storage as >> +- * needed. All storage allocated in this way is owned by the object >> +- * which created it, and will be freed when it is no longer needed, or >> +- * when the object's destructor is invoked. >> ++ * NOTE: in all methods below, output parameters are references to pointers so >> ++ * the method can allocate and free the storage as needed. All storage allocated >> ++ * in this way is owned by the object which created it, and will be freed when it >> ++ * is no longer needed, or when the object's destructor is invoked. >> + * >> + * @see LEFontInstance >> + * @see ScriptAndLanguageTags.h >> + * >> + * @stable ICU 2.8 >> + */ >> +-class U_LAYOUT_API LayoutEngine >> +-{ >> ++class U_LAYOUT_API LayoutEngine : public UObject { >> + protected: >> + /** >> + * The object which holds the glyph storage >> +@@ -134,21 +133,21 @@ >> + le_int32 fTypoFlags; >> + >> + /** >> +- * This constructs an instance for a given font, script and >> +- * language. Subclass constructors >> ++ * This constructs an instance for a given font, script and language. Subclass constructors >> + * must call this constructor. >> + * >> + * @param fontInstance - the font for the text >> + * @param scriptCode - the script for the text >> + * @param languageCode - the language for the text >> ++ * @param typoFlags - the typographic control flags for the text. Set bit 1 if kerning >> ++ * is desired, set bit 2 if ligature formation is desired. Others are reserved. >> + * >> + * @see LEFontInstance >> + * @see ScriptAndLanguageTags.h >> + * >> + * @internal >> + */ >> +- LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, le_int32 typoFlags); >> ++ LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> + >> + /** >> + * This overrides the default no argument constructor to make it >> +@@ -160,11 +159,10 @@ >> + LayoutEngine(); >> + >> + /** >> +- * This method does any required pre-processing to the input >> +- * characters. It may generate output characters that differ from >> +- * the input charcters due to insertions, deletions, or >> +- * reorderings. In such cases, it will also generate an output >> +- * character index array reflecting these changes. >> ++ * This method does any required pre-processing to the input characters. It >> ++ * may generate output characters that differ from the input charcters due to >> ++ * insertions, deletions, or reorderings. In such cases, it will also generate an >> ++ * output character index array reflecting these changes. >> + * >> + * Subclasses must override this method. >> + * >> +@@ -173,44 +171,36 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the characters are in a right to >> +- * left directional run >> +- * @param outChars - the output character array, if different from >> +- * the input >> +- * @param glyphStorage - the object that holds the per-glyph >> +- * storage. The character index array may be set. >> ++ * @param rightToLeft - TRUE if the characters are in a right to left directional run >> ++ * @param outChars - the output character array, if different from the input >> ++ * @param glyphStorage - the object that holds the per-glyph storage. The character index array may be set. >> + * @param success - set to an error code if the operation fails >> +- * @return the output character count (input character count if no >> +- * change) >> ++ * >> ++ * @return the output character count (input character count if no change) >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +- * This method does the glyph processing. It converts an array of >> +- * characters into an array of glyph indices and character >> +- * indices. The characters to be processed are passed in a >> +- * surrounding context. The context is specified as a starting >> +- * address and a maximum character count. An offset and a count >> +- * are used to specify the characters to be processed. >> ++ * This method does the glyph processing. It converts an array of characters >> ++ * into an array of glyph indices and character indices. The characters to be >> ++ * processed are passed in a surrounding context. The context is specified as >> ++ * a starting address and a maximum character count. An offset and a count are >> ++ * used to specify the characters to be processed. >> + * >> +- * The default implementation of this method only does character >> +- * to glyph mapping. Subclasses needing more elaborate glyph >> +- * processing must override this method. >> ++ * The default implementation of this method only does character to glyph mapping. >> ++ * Subclasses needing more elaborate glyph processing must override this method. >> + * >> + * Input parameters: >> + * @param chars - the character context >> + * @param offset - the offset of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the context. >> +- * @param rightToLeft - TRUE if the text is in a right to left >> +- * directional run >> +- * @param glyphStorage - the object which holds the per-glyph >> +- * storage. The glyph and char indices arrays will be >> +- * set. >> ++ * @param rightToLeft - TRUE if the text is in a right to left directional run >> ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph and char indices arrays >> ++ * will be set. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -219,60 +209,50 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +- * This method does basic glyph positioning. The default >> +- * implementation positions the glyphs based on their advance >> +- * widths. This is sufficient for most uses. It is not expected >> +- * that many subclasses will override this method. >> ++ * This method does basic glyph positioning. The default implementation positions >> ++ * the glyphs based on their advance widths. This is sufficient for most uses. It >> ++ * is not expected that many subclasses will override this method. >> + * >> + * Input parameters: >> +- * @param glyphStorage - the object which holds the per-glyph storage. >> +- * The glyph position array will be set. >> ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph position array will be set. >> + * @param x - the starting X position >> + * @param y - the starting Y position >> + * @param success - set to an error code if the operation fails >> + * >> + * @internal >> + */ >> +- virtual void positionGlyphs(LEGlyphStorage &glyphStorage, >> +- float x, float y, LEErrorCode &success); >> ++ virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success); >> + >> + /** >> +- * This method does positioning adjustments like accent >> +- * positioning and kerning. The default implementation does >> +- * nothing. Subclasses needing position adjustments must override >> +- * this method. >> ++ * This method does positioning adjustments like accent positioning and >> ++ * kerning. The default implementation does nothing. Subclasses needing >> ++ * position adjustments must override this method. >> + * >> +- * Note that this method has both characters and glyphs as input >> +- * so that it can use the character codes to determine glyph types >> +- * if that information isn't directly available. (e.g. Some Arabic >> +- * OpenType fonts don't have a GDEF table) >> ++ * Note that this method has both characters and glyphs as input so that >> ++ * it can use the character codes to determine glyph types if that information >> ++ * isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF >> ++ * table) >> + * >> + * @param chars - the input character context >> + * @param offset - the offset of the first character to process >> + * @param count - the number of characters to process >> +- * @param reverse - TRUE if the glyphs in the glyph >> +- * array have been reordered >> +- * @param glyphStorage - the object which holds the per-glyph >> +- * storage. The glyph positions will be adjusted as needed. >> +- * @param success - output parameter set to an error code if the >> +- * operation fails >> ++ * @param reverse - TRUE if the glyphs in the glyph array have been reordered >> ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be >> ++ * adjusted as needed. >> ++ * @param success - output parameter set to an error code if the operation fails >> + * >> + * @internal >> + */ >> +- virtual void adjustGlyphPositions(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_bool reverse, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +- * This method gets a table from the font associated with the >> +- * text. The default implementation gets the table from the font >> +- * instance. Subclasses which need to get the tables some other >> +- * way must override this method. >> ++ * This method gets a table from the font associated with >> ++ * the text. The default implementation gets the table from >> ++ * the font instance. Subclasses which need to get the tables >> ++ * some other way must override this method. >> + * >> + * @param tableTag - the four byte table tag. >> + * >> +@@ -283,127 +263,106 @@ >> + virtual const void *getFontTable(LETag tableTag) const; >> + >> + /** >> +- * This method does character to glyph mapping. The default >> +- * implementation uses the font instance to do the mapping. It >> +- * will allocate the glyph and character index arrays if they're >> +- * not already allocated. If it allocates the character index >> +- * array, it will fill it it. >> ++ * This method does character to glyph mapping. The default implementation >> ++ * uses the font instance to do the mapping. It will allocate the glyph and >> ++ * character index arrays if they're not already allocated. If it allocates the >> ++ * character index array, it will fill it it. >> + * >> +- * This method supports right to left text with the ability to >> +- * store the glyphs in reverse order, and by supporting character >> +- * mirroring, which will replace a character which has a left and >> +- * right form, such as parens, with the opposite form before >> +- * mapping it to a glyph index. >> ++ * This method supports right to left >> ++ * text with the ability to store the glyphs in reverse order, and by supporting >> ++ * character mirroring, which will replace a character which has a left and right >> ++ * form, such as parens, with the opposite form before mapping it to a glyph index. >> + * >> + * Input parameters: >> + * @param chars - the input character context >> + * @param offset - the offset of the first character to be mapped >> + * @param count - the number of characters to be mapped >> +- * @param reverse - if TRUE, the output will be in >> +- * reverse order >> ++ * @param reverse - if TRUE, the output will be in reverse order >> + * @param mirror - if TRUE, do character mirroring >> +- * @param glyphStorage - the object which holds the per-glyph >> +- * storage. The glyph and char indices arrays will be >> +- * filled in. >> ++ * @param glyphStorage - the object which holds the per-glyph storage. The glyph and char >> ++ * indices arrays will be filled in. >> + * @param success - set to an error code if the operation fails >> + * >> + * @see LEFontInstance >> + * >> + * @internal >> + */ >> +- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, le_bool mirror, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> +- * This is a convenience method that forces the advance width of >> +- * mark glyphs to be zero, which is required for proper selection >> +- * and highlighting. >> ++ * This is a convenience method that forces the advance width of mark >> ++ * glyphs to be zero, which is required for proper selection and highlighting. >> + * >> +- * @param glyphStorage - the object containing the per-glyph >> +- * storage. The positions array will be modified. >> ++ * @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified. >> + * @param markFilter - used to identify mark glyphs >> +- * @param success - output parameter set to an error code if the >> +- * operation fails >> ++ * @param success - output parameter set to an error code if the operation fails >> + * >> + * @see LEGlyphFilter >> + * >> + * @internal >> + */ >> +- static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, >> +- LEGlyphFilter *markFilter, LEErrorCode &success); >> ++ static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); >> + >> + >> + /** >> +- * This is a convenience method that forces the advance width of >> +- * mark glyphs to be zero, which is required for proper selection >> +- * and highlighting. This method uses the input characters to >> +- * identify marks. This is required in cases where the font does >> +- * not contain enough information to identify them based on the >> +- * glyph IDs. >> ++ * This is a convenience method that forces the advance width of mark >> ++ * glyphs to be zero, which is required for proper selection and highlighting. >> ++ * This method uses the input characters to identify marks. This is required in >> ++ * cases where the font does not contain enough information to identify them based >> ++ * on the glyph IDs. >> + * >> + * @param chars - the array of input characters >> + * @param charCount - the number of input characers >> +- * @param glyphStorage - the object containing the per-glyph >> +- * storage. The positions array will be modified. >> +- * @param reverse - TRUE if the glyph array has been >> +- * reordered >> ++ * @param glyphStorage - the object containing the per-glyph storage. The positions array will be modified. >> ++ * @param reverse - TRUE if the glyph array has been reordered >> + * @param markFilter - used to identify mark glyphs >> +- * @param success - output parameter set to an error code if the >> +- * operation fails >> ++ * @param success - output parameter set to an error code if the operation fails >> + * >> + * @see LEGlyphFilter >> + * >> + * @internal >> + */ >> +- static void adjustMarkGlyphs(const LEUnicode chars[], >> +- le_int32 charCount, le_bool reverse, >> +- LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, >> +- LEErrorCode &success); >> ++ static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); >> ++ >> + >> + public: >> + /** >> + * The destructor. It will free any storage allocated for the >> + * glyph, character index and position arrays by calling the reset >> +- * method. It is declared virtual so that it will be invoked by >> +- * the subclass destructors. >> ++ * method. It is declared virtual so that it will be invoked by the >> ++ * subclass destructors. >> + * >> + * @stable ICU 2.8 >> + */ >> + virtual ~LayoutEngine(); >> + >> + /** >> +- * This method will invoke the layout steps in their correct order >> +- * by calling the 32 bit versions of the computeGlyphs and >> +- * positionGlyphs methods.(It doesn't * call the >> +- * adjustGlyphPositions method because that doesn't apply for >> +- * default * processing.) It will compute the glyph, character >> +- * index and position arrays. >> ++ * This method will invoke the layout steps in their correct order by calling >> ++ * the computeGlyphs, positionGlyphs and adjustGlyphPosition methods.. It will >> ++ * compute the glyph, character index and position arrays. >> + * >> + * @param chars - the input character context >> + * @param offset - the offset of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - true if the characers are in a right to >> +- * left directional run >> ++ * @param rightToLeft - TRUE if the characers are in a right to left directional run >> + * @param x - the initial X position >> + * @param y - the initial Y position >> +- * @param success - output parameter set to an error code if the >> +- * operation fails >> ++ * @param success - output parameter set to an error code if the operation fails >> ++ * >> + * @return the number of glyphs in the glyph array >> + * >> +- * Note: the glyph, character index and position array can be >> +- * accessed using the getter method below. >> ++ * Note; the glyph, character index and position array can be accessed >> ++ * using the getter method below. >> ++ * >> ++ * @stable ICU 2.8 >> + */ >> +- le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, float x, >> +- float y, LEErrorCode &success); >> ++ virtual le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success); >> + >> + /** >> +- * This method returns the number of glyphs in the glyph >> +- * array. Note that the number of glyphs will be greater than or >> +- * equal to the number of characters used to create the >> +- * LayoutEngine. >> ++ * This method returns the number of glyphs in the glyph array. Note >> ++ * that the number of glyphs will be greater than or equal to the number >> ++ * of characters used to create the LayoutEngine. >> + * >> + * @return the number of glyphs in the glyph array >> + * >> +@@ -412,9 +371,9 @@ >> + le_int32 getGlyphCount() const; >> + >> + /** >> +- * This method copies the glyph array into a caller supplied >> +- * array. The caller must ensure that the array is large enough >> +- * to hold all the glyphs. >> ++ * This method copies the glyph array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold all >> ++ * the glyphs. >> + * >> + * @param glyphs - the destiniation glyph array >> + * @param success - set to an error code if the operation fails >> +@@ -424,10 +383,10 @@ >> + void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the glyph array into a caller supplied >> +- * array, ORing in extra bits. (This functionality is needed by >> +- * the JDK, which uses 32 bits pre glyph idex, with the high 16 >> +- * bits encoding the composite font slot number) >> ++ * This method copies the glyph array into a caller supplied array, >> ++ * ORing in extra bits. (This functionality is needed by the JDK, >> ++ * which uses 32 bits pre glyph idex, with the high 16 bits encoding >> ++ * the composite font slot number) >> + * >> + * @param glyphs - the destination (32 bit) glyph array >> + * @param extraBits - this value will be ORed with each glyph index >> +@@ -435,13 +394,12 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, >> +- LEErrorCode &success) const; >> ++ virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the character index array into a caller >> +- * supplied array. The caller must ensure that the array is large >> +- * enough to hold a character index for each glyph. >> ++ * This method copies the character index array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold a >> ++ * character index for each glyph. >> + * >> + * @param charIndices - the destiniation character index array >> + * @param success - set to an error code if the operation fails >> +@@ -451,9 +409,9 @@ >> + void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the character index array into a caller >> +- * supplied array. The caller must ensure that the array is large >> +- * enough to hold a character index for each glyph. >> ++ * This method copies the character index array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold a >> ++ * character index for each glyph. >> + * >> + * @param charIndices - the destiniation character index array >> + * @param indexBase - an offset which will be added to each index >> +@@ -461,14 +419,13 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- void getCharIndices(le_int32 charIndices[], le_int32 indexBase, >> +- LEErrorCode &success) const; >> ++ void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; >> + >> + /** >> +- * This method copies the position array into a caller supplied >> +- * array. The caller must ensure that the array is large enough >> +- * to hold an X and Y position for each glyph, plus an extra X and >> +- * Y for the advance of the last glyph. >> ++ * This method copies the position array into a caller supplied array. >> ++ * The caller must ensure that the array is large enough to hold an >> ++ * X and Y position for each glyph, plus an extra X and Y for the >> ++ * advance of the last glyph. >> + * >> + * @param positions - the destiniation position array >> + * @param success - set to an error code if the operation fails >> +@@ -491,8 +448,7 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, >> +- LEErrorCode &success) const; >> ++ void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; >> + >> + /** >> + * This method frees the glyph, character index and position arrays >> +@@ -511,8 +467,7 @@ >> + * @param fontInstance - the font of the text >> + * @param scriptCode - the script of the text >> + * @param languageCode - the language of the text >> +- * @param success - output parameter set to an error code if the >> +- * operation fails >> ++ * @param success - output parameter set to an error code if the operation fails >> + * >> + * @return a LayoutEngine which can layout text in the given font. >> + * >> +@@ -520,17 +475,30 @@ >> + * >> + * @stable ICU 2.8 >> + */ >> +- static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); >> ++ static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); >> + >> + /** >> + * Override of existing call that provides flags to control typography. >> + * @draft ICU 3.4 >> + */ >> +- static LayoutEngine *layoutEngineFactory( >> +- const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, >> +- le_int32 typo_flags, LEErrorCode &success); >> ++ static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success); >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LayoutTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LayoutTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LayoutTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,20 @@ >> + #ifndef __LAYOUTTABLES_H >> + #define __LAYOUTTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define ANY_NUMBER 1 >> + >> + typedef le_int16 ByteOffset; >> + typedef le_int16 WordOffset; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstProc.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,10 +39,14 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define ExtendedComplement(m) ((le_int32) (~((le_uint32) (m)))) >> + #define SignBit(m) ((ExtendedComplement(m) >> 1) & (le_int32)(m)) >> + #define SignExtend(v,m) (((v) & SignBit(m))? ((v) | ExtendedComplement(m)): (v)) >> + >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LigatureSubstitutionProcessor) >> ++ >> + LigatureSubstitutionProcessor::LigatureSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader) >> + : StateTableProcessor(morphSubtableHeader) >> + { >> +@@ -63,8 +67,7 @@ >> + m = -1; >> + } >> + >> +-ByteOffset LigatureSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, >> +- le_int32 &currGlyph, EntryTableIndex index) >> ++ByteOffset LigatureSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index) >> + { >> + const LigatureSubstitutionStateEntry *entry = &entryTable[index]; >> + ByteOffset newState = SWAPW(entry->newStateOffset); >> +@@ -135,3 +138,5 @@ >> + void LigatureSubstitutionProcessor::endStateTable() >> + { >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstProc.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstProc.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstProc.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __LIGATURESUBSTITUTIONPROCESSOR_H >> + #define __LIGATURESUBSTITUTIONPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "StateTableProcessor.h" >> + #include "LigatureSubstitution.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + #define nComponents 16 >> +@@ -54,6 +61,20 @@ >> + LigatureSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader); >> + virtual ~LigatureSubstitutionProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + LigatureSubstitutionProcessor(); >> + >> +@@ -68,6 +89,8 @@ >> + le_int16 m; >> + >> + const LigatureSubstitutionHeader *ligatureSubstitutionHeader; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved >> + * >> + */ >> +@@ -37,6 +38,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 LigatureSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const >> + { >> + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); >> +@@ -92,3 +95,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __LIGATURESUBSTITUTIONSUBTABLES_H >> + #define __LIGATURESUBSTITUTIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphSubstitutionTables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct LigatureSetTable >> + { >> + le_uint16 ligatureCount; >> +@@ -59,4 +66,5 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LigatureSubstitution.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LigatureSubstitution.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstitution.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __LIGATURESUBSTITUTION_H >> + #define __LIGATURESUBSTITUTION_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "StateTables.h" >> + #include "MorphTables.h" >> + #include "MorphStateTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct LigatureSubstitutionHeader : MorphStateTableHeader >> + { >> + ByteOffset ligatureActionTableOffset; >> +@@ -65,4 +72,5 @@ >> + lafComponentOffsetMask = 0x3FFFFFFF >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -42,6 +42,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 LookupProcessor::applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, >> + const LEFontInstance *fontInstance) const >> + { >> +@@ -65,10 +67,9 @@ >> + return 1; >> + } >> + >> +-le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, >> +- GlyphPositionAdjustments *glyphPositionAdjustments, >> +- le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEFontInstance *fontInstance) const >> ++le_int32 LookupProcessor::process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, >> ++ le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> ++ const LEFontInstance *fontInstance) const >> + { >> + le_int32 glyphCount = glyphStorage.getGlyphCount(); >> + >> +@@ -133,8 +134,7 @@ >> + >> + LookupProcessor::LookupProcessor(const char *baseAddress, >> + Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, >> +- LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, >> +- le_int32 featureMapCount, le_bool orderFeatures) >> ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures) >> + : lookupListTable(NULL), featureListTable(NULL), lookupSelectArray(NULL), >> + lookupOrderArray(NULL), lookupOrderCount(0) >> + { >> +@@ -296,3 +296,5 @@ >> + LE_DELETE_ARRAY(lookupOrderArray); >> + LE_DELETE_ARRAY(lookupSelectArray); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -32,9 +33,18 @@ >> + #ifndef __LOOKUPPROCESSOR_H >> + #define __LOOKUPPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> ++//#include "Lookups.h" >> ++//#include "Features.h" >> ++ >> ++U_NAMESPACE_BEGIN >> + >> + class LEFontInstance; >> + class LEGlyphStorage; >> +@@ -46,13 +56,10 @@ >> + struct LookupSubtable; >> + struct LookupTable; >> + >> +-class LookupProcessor >> +-{ >> ++class LookupProcessor : public UMemory { >> + public: >> +- le_int32 process(LEGlyphStorage &glyphStorage, >> +- GlyphPositionAdjustments *glyphPositionAdjustments, >> +- le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, >> +- const LEFontInstance *fontInstance) const; >> ++ le_int32 process(LEGlyphStorage &glyphStorage, GlyphPositionAdjustments *glyphPositionAdjustments, >> ++ le_bool rightToLeft, const GlyphDefinitionTableHeader *glyphDefinitionTableHeader, const LEFontInstance *fontInstance) const; >> + >> + le_uint32 applyLookupTable(const LookupTable *lookupTable, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + >> +@@ -64,19 +71,18 @@ >> + virtual ~LookupProcessor(); >> + >> + protected: >> +- LookupProcessor(const char *baseAddress, >> ++ LookupProcessor(const char *baseAddress, >> + Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset, >> +- LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, >> +- le_int32 featureMapCount, le_bool orderFeatures); >> ++ LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures); >> + >> +- LookupProcessor(); >> ++ LookupProcessor(); >> + >> + le_int32 selectLookups(const FeatureTable *featureTable, FeatureMask featureMask, le_int32 order); >> + >> + const LookupListTable *lookupListTable; >> + const FeatureListTable *featureListTable; >> + >> +- FeatureMask *lookupSelectArray; >> ++ FeatureMask *lookupSelectArray; >> + >> + le_uint16 *lookupOrderArray; >> + le_uint32 lookupOrderCount; >> +@@ -87,4 +93,5 @@ >> + LookupProcessor &operator=(const LookupProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "LookupTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /* >> + These are the rolled-up versions of the uniform binary search. >> + Someday, if we need more performance, we can un-roll them. >> +@@ -104,3 +106,5 @@ >> + >> + return NULL; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/LookupTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/LookupTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/LookupTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __LOOKUPTABLES_H >> + #define __LOOKUPTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + enum LookupTableFormat >> + { >> + ltfSimpleArray = 0, >> +@@ -104,4 +111,5 @@ >> + LookupValue valueArray[ANY_NUMBER]; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Lookups.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Lookups.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/Lookups.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "CoverageTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const LookupTable *LookupListTable::getLookupTable(le_uint16 lookupTableIndex) const >> + { >> + if (lookupTableIndex >= SWAPW(lookupCount)) { >> +@@ -63,3 +65,5 @@ >> + >> + return coverageTable->getGlyphCoverage(glyphID); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/Lookups.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/Lookups.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/Lookups.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __LOOKUPS_H >> + #define __LOOKUPS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + enum LookupFlags >> + { >> + lfBaselineIsLogicalEnd = 0x0001, // The MS spec. calls this flag "RightToLeft" but this name is more accurate >> +@@ -79,6 +86,5 @@ >> + return getGlyphCoverage(coverageTableOffset, glyphID); >> + } >> + >> +- >> +- >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MPreFixups.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MPreFixups.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MPreFixups.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -33,6 +33,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "MPreFixups.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct FixupData >> + { >> + le_int32 fBaseIndex; >> +@@ -92,7 +94,7 @@ >> + >> + for (i = 0; i < mpreCount; i += 1) { >> + mpreSave[i] = glyphStorage[mpreIndex + i]; >> +- indexSave[i] = glyphStorage.getCharIndex(mpreIndex + i, success); >> ++ indexSave[i] = glyphStorage.getCharIndex(mpreIndex + i, success); //charIndices[mpreIndex + i]; >> + } >> + >> + for (i = 0; i < moveCount; i += 1) { >> +@@ -112,3 +114,5 @@ >> + LE_DELETE_ARRAY(mpreSave); >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MPreFixups.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MPreFixups.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MPreFixups.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,14 +32,22 @@ >> + #ifndef __MPREFIXUPS_H >> + #define __MPREFIXUPS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + // Might want to make this a private member... >> + struct FixupData; >> + >> +-class MPreFixups { >> ++class MPreFixups : public UMemory >> ++{ >> + public: >> + MPreFixups(le_int32 charCount); >> + ~MPreFixups(); >> +@@ -53,4 +61,7 @@ >> + le_int32 fFixupCount; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkArrays.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkArrays.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkArrays.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,8 @@ >> + #include "MarkArrays.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_int32 MarkArray::getMarkClass(LEGlyphID glyphID, le_int32 coverageIndex, const LEFontInstance *fontInstance, >> + LEPoint &anchor) const >> + { >> +@@ -58,3 +60,5 @@ >> + >> + return markClass; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkArrays.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkArrays.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkArrays.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,10 +32,17 @@ >> + #ifndef __MARKARRAYS_H >> + #define __MARKARRAYS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct MarkRecord >> + { >> + le_uint16 markClass; >> +@@ -51,4 +58,7 @@ >> + LEPoint &anchor) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -40,6 +40,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + LEGlyphID MarkToBasePositioningSubtable::findBaseGlyph(GlyphIterator *glyphIterator) const >> + { >> + if (glyphIterator->prev()) { >> +@@ -106,7 +108,6 @@ >> + glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); >> + >> + if (glyphIterator->isRightToLeft()) { >> +- // dlf flip advance to local coordinate system >> + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); >> + } else { >> + LEPoint baseAdvance; >> +@@ -114,9 +115,10 @@ >> + fontInstance->getGlyphAdvance(baseGlyph, pixels); >> + fontInstance->pixelsToUnits(pixels, baseAdvance); >> + >> +- // flip advances to local coordinate system >> + glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); >> + } >> + >> + return 1; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToBasePosnSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __MARKTOBASEPOSITIONINGSUBTABLES_H >> + #define __MARKTOBASEPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "AttachmentPosnSubtables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct MarkToBasePositioningSubtable : AttachmentPositioningSubtable >> + { >> + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> +@@ -56,4 +63,6 @@ >> + BaseRecord baseRecordArray[ANY_NUMBER]; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + LEGlyphID MarkToLigaturePositioningSubtable::findLigatureGlyph(GlyphIterator *glyphIterator) const >> + { >> + if (glyphIterator->prev()) { >> +@@ -117,9 +119,10 @@ >> + fontInstance->getGlyphAdvance(ligatureGlyph, pixels); >> + fontInstance->pixelsToUnits(pixels, ligatureAdvance); >> + >> +- glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - ligatureAdvance.fX, >> +- anchorDiffY - ligatureAdvance.fY, -markAdvance.fX, -markAdvance.fY); >> ++ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - ligatureAdvance.fX, anchorDiffY - ligatureAdvance.fY, -markAdvance.fX, -markAdvance.fY); >> + } >> + >> + return 1; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __MARKTOLIGATUREPOSITIONINGSUBTABLES_H >> + #define __MARKTOLIGATUREPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "AttachmentPosnSubtables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct MarkToLigaturePositioningSubtable : AttachmentPositioningSubtable >> + { >> + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> +@@ -62,4 +69,6 @@ >> + Offset ligatureAttachTableOffsetArray[ANY_NUMBER]; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -40,6 +40,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + LEGlyphID MarkToMarkPositioningSubtable::findMark2Glyph(GlyphIterator *glyphIterator) const >> + { >> + if (glyphIterator->findMark2Glyph()) { >> +@@ -88,7 +90,7 @@ >> + const AnchorTable *anchorTable = (const AnchorTable *) ((char *) mark2Array + anchorTableOffset); >> + LEPoint mark2Anchor, markAdvance, pixels; >> + >> +- if (anchorTableOffset == 0) { // jb4729 >> ++ if (anchorTableOffset == 0) { >> + // this seems to mean that the marks don't attach... >> + return 0; >> + } >> +@@ -111,9 +113,10 @@ >> + fontInstance->getGlyphAdvance(mark2Glyph, pixels); >> + fontInstance->pixelsToUnits(pixels, mark2Advance); >> + >> +- glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - mark2Advance.fX, >> +- anchorDiffY - mark2Advance.fY, -markAdvance.fX, -markAdvance.fY); >> ++ glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - mark2Advance.fX, anchorDiffY - mark2Advance.fY, -markAdvance.fX, -markAdvance.fY); >> + } >> + >> + return 1; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __MARKTOMARKPOSITIONINGSUBTABLES_H >> + #define __MARKTOMARKPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "AttachmentPosnSubtables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct MarkToMarkPositioningSubtable : AttachmentPositioningSubtable >> + { >> + le_int32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> +@@ -56,4 +63,6 @@ >> + Mark2Record mark2RecordArray[ANY_NUMBER]; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MirroredCharData.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MirroredCharData.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MirroredCharData.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,8 @@ >> + #include "LETypes.h" >> + #include "DefaultCharMapper.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const LEUnicode32 DefaultCharMapper::mirroredChars[] = { >> + 0x0028, 0x0029, 0x003C, 0x003E, 0x005B, 0x005D, 0x007B, 0x007D, >> + 0x00AB, 0x00BB, 0x2039, 0x203A, 0x2045, 0x2046, 0x207D, 0x207E, >> +@@ -127,3 +129,5 @@ >> + }; >> + >> + const le_int32 DefaultCharMapper::mirroredCharsCount = 332; >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphStateTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphStateTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphStateTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,14 +32,22 @@ >> + #ifndef __MORPHSTATETABLES_H >> + #define __MORPHSTATETABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "MorphTables.h" >> + #include "StateTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct MorphStateTableHeader : MorphSubtableHeader >> + { >> + StateTableHeader stHeader; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -42,6 +42,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + void MorphTableHeader::process(LEGlyphStorage &glyphStorage) const >> + { >> + const ChainHeader *chainHeader = chains; >> +@@ -114,3 +116,5 @@ >> + delete processor; >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MorphTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MorphTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MorphTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __MORPHTABLES_H >> + #define __MORPHTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + typedef le_uint32 FeatureFlags; >> +@@ -98,4 +105,6 @@ >> + void process(LEGlyphStorage &glyphStorage) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MultipleSubstSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 MultipleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const >> + { >> + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); >> +@@ -106,3 +108,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/MultipleSubstSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __MULTIPLESUBSTITUTIONSUBTABLES_H >> + #define __MULTIPLESUBSTITUTIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphSubstitutionTables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct SequenceTable >> + { >> + le_uint16 glyphCount; >> +@@ -52,4 +59,5 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubst.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubst.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubst.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved >> + * >> + */ >> +@@ -32,14 +33,23 @@ >> + #ifndef __NONCONTEXTUALGLYPHSUBSTITUTION_H >> + #define __NONCONTEXTUALGLYPHSUBSTITUTION_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + #include "LookupTables.h" >> + #include "MorphTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct NonContextualGlyphSubstitutionHeader : MorphSubtableHeader >> + { >> + LookupTable table; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -41,6 +41,8 @@ >> + #include "TrimmedArrayProcessor.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + NonContextualGlyphSubstitutionProcessor::NonContextualGlyphSubstitutionProcessor() >> + { >> + } >> +@@ -79,3 +81,5 @@ >> + return NULL; >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,18 @@ >> + #ifndef __NONCONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H >> + #define __NONCONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class NonContextualGlyphSubstitutionProcessor : public SubtableProcessor >> +@@ -57,4 +64,5 @@ >> + NonContextualGlyphSubstitutionProcessor &operator=(const NonContextualGlyphSubstitutionProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -47,6 +47,10 @@ >> + >> + #include "GDEFMarkFilter.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(OpenTypeLayoutEngine) >> ++ >> + #define ccmpFeatureTag LE_CCMP_FEATURE_TAG >> + #define ligaFeatureTag LE_LIGA_FEATURE_TAG >> + #define cligFeatureTag LE_CLIG_FEATURE_TAG >> +@@ -78,7 +82,7 @@ >> + {ccmpFeatureTag, ccmpFeatureMask}, >> + {ligaFeatureTag, ligaFeatureMask}, >> + {cligFeatureTag, cligFeatureMask}, >> +- {kernFeatureTag, kernFeatureMask}, >> ++ {kernFeatureTag, kernFeatureMask}, >> + {paltFeatureTag, paltFeatureMask}, >> + {markFeatureTag, markFeatureMask}, >> + {mkmkFeatureTag, mkmkFeatureMask} >> +@@ -86,19 +90,15 @@ >> + >> + static const le_int32 featureMapCount = LE_ARRAY_SIZE(featureMap); >> + >> +-OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, >> +- const GlyphSubstitutionTableHeader *gsubTable) >> +- : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), >> +- fFeatureMask(minimalFeatures), fFeatureMap(featureMap), >> +- fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE), >> +- fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), >> +- fSubstitutionFilter(NULL) >> ++OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable) >> ++ : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureMask(minimalFeatures), >> ++ fFeatureMap(featureMap), fFeatureMapCount(featureMapCount), fFeatureOrder(FALSE), >> ++ fGSUBTable(gsubTable), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) >> + { >> + static const le_uint32 gdefTableTag = LE_GDEF_TABLE_TAG; >> + static const le_uint32 gposTableTag = LE_GPOS_TABLE_TAG; >> +- const GlyphPositioningTableHeader *gposTable = >> +- (const GlyphPositioningTableHeader *) getFontTable(gposTableTag); >> ++ const GlyphPositioningTableHeader *gposTable = (const GlyphPositioningTableHeader *) getFontTable(gposTableTag); >> + >> + // todo: switch to more flags and bitfield rather than list of feature tags? >> + switch (typoFlags) { >> +@@ -127,11 +127,10 @@ >> + LayoutEngine::reset(); >> + } >> + >> +-OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> +- : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), >> +- fFeatureOrder(FALSE), fGSUBTable(NULL), fGDEFTable(NULL), >> +- fGPOSTable(NULL), fSubstitutionFilter(NULL) >> ++OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags) >> ++ : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags), fFeatureOrder(FALSE), >> ++ fGSUBTable(NULL), fGDEFTable(NULL), fGPOSTable(NULL), fSubstitutionFilter(NULL) >> + { >> + setScriptAndLanguageTags(); >> + } >> +@@ -165,9 +164,8 @@ >> + fLangSysTag = getLangSysTag(fLanguageCode); >> + } >> + >> +-le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], >> +- le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -178,8 +176,7 @@ >> + return 0; >> + } >> + >> +- le_int32 outCharCount = LayoutEngine::characterProcessing(chars, offset, count, >> +- max, rightToLeft, outChars, glyphStorage, success); >> ++ le_int32 outCharCount = LayoutEngine::characterProcessing(chars, offset, count, max, rightToLeft, outChars, glyphStorage, success); >> + >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -197,16 +194,14 @@ >> + >> + // Input: characters, tags >> + // Output: glyphs, char indices >> +-le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 OpenTypeLayoutEngine::glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || >> +- offset >= max || offset + count > max) { >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> +@@ -218,16 +213,14 @@ >> + } >> + >> + if (fGSUBTable != NULL) { >> +- count = fGSUBTable->process(glyphStorage, rightToLeft, >> +- fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, >> +- fFeatureMap, fFeatureMapCount, fFeatureOrder); >> ++ count = fGSUBTable->process(glyphStorage, rightToLeft, fScriptTag, fLangSysTag, fGDEFTable, fSubstitutionFilter, >> ++ fFeatureMap, fFeatureMapCount, fFeatureOrder); >> + } >> + >> + return count; >> + } >> + >> +-le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 OpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> +@@ -241,9 +234,7 @@ >> + return glyphStorage.getGlyphCount(); >> + } >> + >> +-le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, >> +- LEErrorCode &success) >> ++le_int32 OpenTypeLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + LEUnicode *outChars = NULL; >> + LEGlyphStorage fakeGlyphStorage; >> +@@ -253,25 +244,19 @@ >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || >> +- offset >= max || offset + count > max) { >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> + >> +- outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, >> +- outChars, fakeGlyphStorage, success); >> ++ outCharCount = characterProcessing(chars, offset, count, max, rightToLeft, outChars, fakeGlyphStorage, success); >> + >> + if (outChars != NULL) { >> +- fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, >> +- rightToLeft, fakeGlyphStorage, success); >> +- // FIXME: a subclass may have allocated this, in which case >> +- // this delete might not work... >> +- LE_DELETE_ARRAY(outChars); >> ++ fakeGlyphCount = glyphProcessing(outChars, 0, outCharCount, outCharCount, rightToLeft, fakeGlyphStorage, success); >> ++ LE_DELETE_ARRAY(outChars); // FIXME: a subclass may have allocated this, in which case this delete might not work... >> + //adjustGlyphs(outChars, 0, outCharCount, rightToLeft, fakeGlyphs, fakeGlyphCount); >> + } else { >> +- fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, >> +- fakeGlyphStorage, success); >> ++ fakeGlyphCount = glyphProcessing(chars, offset, count, max, rightToLeft, fakeGlyphStorage, success); >> + //adjustGlyphs(chars, offset, count, rightToLeft, fakeGlyphs, fakeGlyphCount); >> + } >> + >> +@@ -281,8 +266,8 @@ >> + } >> + >> + // apply GPOS table, if any >> +-void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return; >> +@@ -318,8 +303,8 @@ >> + } >> + #endif >> + >> +- fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, >> +- fGDEFTable, fFontInstance, fFeatureMap, fFeatureMapCount, fFeatureOrder); >> ++ fGPOSTable->process(glyphStorage, adjustments, reverse, fScriptTag, fLangSysTag, fGDEFTable, fFontInstance, >> ++ fFeatureMap, fFeatureMapCount, fFeatureOrder); >> + >> + float xAdjust = 0, yAdjust = 0; >> + >> +@@ -354,4 +339,12 @@ >> + >> + delete adjustments; >> + } >> ++ >> ++#if 0 >> ++ // Don't know why this is here... >> ++ LE_DELETE_ARRAY(fFeatureTags); >> ++ fFeatureTags = NULL; >> ++#endif >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -23,9 +23,7 @@ >> + * >> + */ >> + >> +- >> + /* >> +- * >> + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved >> + * >> + */ >> +@@ -42,6 +40,8 @@ >> + #include "GlyphDefinitionTables.h" >> + #include "GlyphPositioningTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /** >> + * OpenTypeLayoutEngine implements complex text layout for OpenType fonts - that is >> + * fonts which have GSUB and GPOS tables associated with them. In order to do this, >> +@@ -87,7 +87,7 @@ >> + * @internal >> + */ >> + OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> +- le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> ++ le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable); >> + >> + /** >> + * This constructor is used when the font requires a "canned" GSUB table which can't be known >> +@@ -95,11 +95,12 @@ >> + * >> + * @param fontInstance - the font >> + * @param scriptCode - the script >> +- * @param languageCode - the language >> ++ * @param langaugeCode - the language >> + * >> + * @internal >> + */ >> +- OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> ++ OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, >> ++ le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -132,6 +133,20 @@ >> + */ >> + static LETag getLangSysTag(le_int32 languageCode); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + >> + /** >> +@@ -254,9 +269,8 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 characterProcessing(const LEUnicode /*chars*/[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool /*rightToLeft*/, >> +- LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 characterProcessing(const LEUnicode /*chars*/[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, >> ++ LEUnicode *&/*outChars*/, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method does character to glyph mapping, and applies the GSUB table. The >> +@@ -287,9 +301,8 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method does any processing necessary to convert "fake" >> +@@ -316,8 +329,7 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method applies the characterProcessing, glyphProcessing and glyphPostProcessing >> +@@ -341,8 +353,7 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, >> +- le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method uses the GPOS table, if there is one, to adjust the glyph positions. >> +@@ -359,8 +370,7 @@ >> + * >> + * @internal >> + */ >> +- virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, >> +- le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> ++ virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + /** >> + * This method frees the feature tag array so that the >> +@@ -372,4 +382,6 @@ >> + virtual void reset(); >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,8 +32,15 @@ >> + #ifndef __OPENTYPETABLES_H >> + #define __OPENTYPETABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define ANY_NUMBER 1 >> + >> + typedef le_uint16 Offset; >> +@@ -62,4 +69,5 @@ >> + FeatureMask mask; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeUtilities.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "OpenTypeUtilities.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // >> + // Finds the high bit by binary searching >> + // through the bits in n. >> +@@ -192,3 +194,7 @@ >> + array[i + 1] = v; >> + } >> + } >> ++ >> ++ >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/OpenTypeUtilities.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,10 +32,17 @@ >> + #ifndef __OPENTYPEUTILITIES_H >> + #define __OPENTYPEUTILITIES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> +-class OpenTypeUtilities { >> ++U_NAMESPACE_BEGIN >> ++ >> ++class OpenTypeUtilities /* not : public UObject because all methods are static */ { >> + public: >> + static le_int8 highBit(le_int32 value); >> + static Offset getTagOffset(LETag tag, const TagAndOffsetRecord *records, le_int32 recordCount); >> +@@ -48,4 +55,5 @@ >> + OpenTypeUtilities() {} // private - forbid instantiation >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/PairPositioningSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,8 @@ >> + #include "OpenTypeUtilities.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 PairPositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const >> + { >> + switch(SWAPW(subtableFormat)) >> +@@ -82,8 +84,7 @@ >> + const PairValueRecord *pairValueRecord = NULL; >> + >> + if (pairValueCount != 0) { >> +- pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), >> +- pairSetTable->pairValueRecordArray, pairValueCount, recordSize); >> ++ pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize); >> + } >> + >> + if (pairValueRecord == NULL) { >> +@@ -91,8 +92,7 @@ >> + } >> + >> + if (valueFormat1 != 0) { >> +- pairValueRecord->valueRecord1.adjustPosition(SWAPW(valueFormat1), (char *) this, >> +- tempIterator, fontInstance); >> ++ pairValueRecord->valueRecord1.adjustPosition(SWAPW(valueFormat1), (char *) this, tempIterator, fontInstance); >> + } >> + >> + if (valueFormat2 != 0) { >> +@@ -171,3 +171,5 @@ >> + >> + return NULL; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/PairPositioningSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __PAIRPOSITIONINGSUBTABLES_H >> + #define __PAIRPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "ValueRecords.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + // NOTE: ValueRecord has a variable size >> + struct PairValueRecord >> + { >> +@@ -96,4 +103,7 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguage.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved >> + * >> + */ >> +@@ -35,6 +36,8 @@ >> + #include "ScriptAndLanguage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const LangSysTable *ScriptTable::findLanguage(LETag languageTag, le_bool exactMatch) const >> + { >> + le_uint16 count = SWAPW(langSysCount); >> +@@ -79,3 +82,5 @@ >> + >> + return scriptTable->findLanguage(languageTag, exactMatch); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguage.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguage.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __SCRIPTANDLANGUAGE_H >> + #define __SCRIPTANDLANGUAGE_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + typedef TagAndOffsetRecord LangSysRecord; >> + >> + struct LangSysTable >> +@@ -65,4 +72,6 @@ >> + const LangSysTable *findLanguage(LETag scriptTag, LETag languageTag, le_bool exactMatch = FALSE) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "ScriptAndLanguageTags.h" >> + #include "OpenTypeLayoutEngine.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const LETag OpenTypeLayoutEngine::scriptTags[] = { >> + zyyyScriptTag, /* 'zyyy' (COMMON) */ >> + qaaiScriptTag, /* 'qaai' (INHERITED) */ >> +@@ -125,3 +127,5 @@ >> + zhsLanguageTag, /* 'ZHS' (Chinese (Simplified)) */ >> + zhtLanguageTag /* 'ZHT' (Chinese (Traditional)) */ >> + }; >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ScriptAndLanguageTags.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ScriptAndLanguageTags.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,13 @@ >> + >> + #include "LETypes.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + const LETag zyyyScriptTag = 0x7A797979; /* 'zyyy' (COMMON) */ >> + const LETag qaaiScriptTag = 0x71616169; /* 'qaai' (INHERITED) */ >> + const LETag arabScriptTag = 0x61726162; /* 'arab' (ARABIC) */ >> +@@ -126,4 +133,6 @@ >> + const LETag zhsLanguageTag = 0x5A485320; /* 'ZHS' (Chinese (Simplified)) */ >> + const LETag zhtLanguageTag = 0x5A485420; /* 'ZHT' (Chinese (Traditional)) */ >> + >> ++ >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentArrayProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SegmentArrayProcessor) >> ++ >> + SegmentArrayProcessor::SegmentArrayProcessor() >> + { >> + } >> +@@ -77,3 +81,5 @@ >> + } >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentArrayProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __SEGMENTARRAYPROCESSOR_H >> + #define __SEGMENTARRAYPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + #include "NonContextualGlyphSubstProc.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class SegmentArrayProcessor : public NonContextualGlyphSubstitutionProcessor >> +@@ -49,11 +56,28 @@ >> + >> + virtual ~SegmentArrayProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + SegmentArrayProcessor(); >> + >> + protected: >> + const SegmentArrayLookupTable *segmentArrayLookupTable; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentSingleProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SegmentSingleProcessor) >> ++ >> + SegmentSingleProcessor::SegmentSingleProcessor() >> + { >> + } >> +@@ -71,3 +75,5 @@ >> + } >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SegmentSingleProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SegmentSingleProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __SEGMENTSINGLEPROCESSOR_H >> + #define __SEGMENTSINGLEPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + #include "NonContextualGlyphSubstProc.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class SegmentSingleProcessor : public NonContextualGlyphSubstitutionProcessor >> +@@ -49,11 +56,28 @@ >> + >> + virtual ~SegmentSingleProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + SegmentSingleProcessor(); >> + >> + protected: >> + const SegmentSingleLookupTable *segmentSingleLookupTable; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ShapingTypeData.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ShapingTypeData.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -36,6 +36,8 @@ >> + #include "LETypes.h" >> + #include "ArabicShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const le_uint8 ArabicShaping::shapingTypeTable[] = { >> + 0x00, 0x02, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0xAD, 0x00, 0x05, 0x03, 0x00, 0x03, 0x6F, 0x00, 0x05, >> + 0x04, 0x83, 0x04, 0x86, 0x00, 0x05, 0x04, 0x88, 0x04, 0x89, 0x00, 0x05, 0x05, 0x91, 0x05, 0xB9, >> +@@ -104,3 +106,5 @@ >> + 0xFE, 0x20, 0xFE, 0x23, 0x00, 0x05, 0xFE, 0xFF, 0xFE, 0xFF, 0x00, 0x05, 0xFF, 0xF9, 0xFF, 0xFB, >> + 0x00, 0x05 >> + }; >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SimpleArrayProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleArrayProcessor) >> ++ >> + SimpleArrayProcessor::SimpleArrayProcessor() >> + { >> + } >> +@@ -68,3 +72,5 @@ >> + } >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SimpleArrayProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SimpleArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __SIMPLEARRAYPROCESSOR_H >> + #define __SIMPLEARRAYPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + #include "NonContextualGlyphSubstProc.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class SimpleArrayProcessor : public NonContextualGlyphSubstitutionProcessor >> +@@ -49,11 +56,28 @@ >> + >> + virtual ~SimpleArrayProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + SimpleArrayProcessor(); >> + >> + protected: >> + const SimpleArrayLookupTable *simpleArrayLookupTable; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SinglePositioningSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 SinglePositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const >> + { >> + switch(SWAPW(subtableFormat)) >> +@@ -84,11 +86,12 @@ >> + le_int16 coverageIndex = (le_int16) getGlyphCoverage(glyph); >> + >> + if (coverageIndex >= 0) { >> +- valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, >> +- *glyphIterator, fontInstance); >> ++ valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); >> + >> + return 1; >> + } >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SinglePositioningSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __SINGLEPOSITIONINGSUBTABLES_H >> + #define __SINGLEPOSITIONINGSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "ValueRecords.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct SinglePositioningSubtable : GlyphPositioningSubtable >> + { >> + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> +@@ -61,4 +68,7 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + le_uint32 SingleSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const >> + { >> + switch(SWAPW(subtableFormat)) >> +@@ -98,3 +100,5 @@ >> + >> + return 0; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleSubstitutionSubtables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __SINGLESUBSTITUTIONSUBTABLES_H >> + #define __SINGLESUBSTITUTIONSUBTABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphSubstitutionTables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct SingleSubstitutionSubtable : GlyphSubstitutionSubtable >> + { >> + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; >> +@@ -58,4 +65,7 @@ >> + le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleTableProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleTableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleTableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SingleTableProcessor) >> ++ >> + SingleTableProcessor::SingleTableProcessor() >> + { >> + } >> +@@ -68,3 +72,5 @@ >> + } >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SingleTableProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SingleTableProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleTableProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __SINGLETABLEPROCESSOR_H >> + #define __SINGLETABLEPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + #include "NonContextualGlyphSubstProc.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class SingleTableProcessor : public NonContextualGlyphSubstitutionProcessor >> +@@ -49,11 +56,27 @@ >> + >> + virtual ~SingleTableProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + SingleTableProcessor(); >> + >> + protected: >> + const SingleTableLookupTable *singleTableLookupTable; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTableProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + StateTableProcessor::StateTableProcessor() >> + { >> + } >> +@@ -96,3 +98,5 @@ >> + >> + endStateTable(); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTableProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTableProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTableProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,18 @@ >> + #ifndef __STATETABLEPROCESSOR_H >> + #define __STATETABLEPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "MorphStateTables.h" >> + #include "SubtableProcessor.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class StateTableProcessor : public SubtableProcessor >> +@@ -72,4 +79,5 @@ >> + StateTableProcessor &operator=(const StateTableProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/StateTables.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/StateTables.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/StateTables.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,9 +32,16 @@ >> + #ifndef __STATETABLES_H >> + #define __STATETABLES_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LayoutTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct StateTableHeader >> + { >> + le_int16 stateSize; >> +@@ -78,4 +85,6 @@ >> + le_int16 flags; >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubstitutionLookups.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SubstitutionLookups.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,8 @@ >> + #include "CoverageTables.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + /* >> + NOTE: This could be optimized somewhat by keeping track >> + of the previous sequenceIndex in the loop and doing next() >> +@@ -65,3 +67,5 @@ >> + lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance); >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubstitutionLookups.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SubstitutionLookups.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,6 +32,11 @@ >> + #ifndef __SUBSTITUTIONLOOKUPS_H >> + #define __SUBSTITUTIONLOOKUPS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> +@@ -39,6 +44,8 @@ >> + #include "GlyphIterator.h" >> + #include "LookupProcessor.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + struct SubstitutionLookupRecord >> + { >> + le_uint16 sequenceIndex; >> +@@ -56,4 +63,6 @@ >> + le_int32 position); >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubtableProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubtableProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SubtableProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -34,6 +34,8 @@ >> + #include "SubtableProcessor.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + SubtableProcessor::SubtableProcessor() >> + { >> + } >> +@@ -50,3 +52,5 @@ >> + SubtableProcessor::~SubtableProcessor() >> + { >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/SubtableProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/SubtableProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/SubtableProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,13 +32,19 @@ >> + #ifndef __SUBTABLEPROCESSOR_H >> + #define __SUBTABLEPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> +-class SubtableProcessor >> +-{ >> ++class SubtableProcessor : public UMemory { >> + public: >> + virtual void process(LEGlyphStorage &glyphStorage) = 0; >> + virtual ~SubtableProcessor(); >> +@@ -60,4 +66,6 @@ >> + SubtableProcessor &operator=(const SubtableProcessor &other); // forbid copying of this class >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiLayoutEngine.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,8 +38,11 @@ >> + >> + #include "ThaiShaping.h" >> + >> +-ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, >> +- le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ThaiLayoutEngine) >> ++ >> ++ThaiLayoutEngine::ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags) >> + : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags) >> + { >> + fErrorChar = 0x25CC; >> +@@ -73,16 +76,13 @@ >> + // Output: glyphs, char indices >> + // Returns: the glyph count >> + // NOTE: this assumes that ThaiShaping::compose will allocate the outChars array... >> +-le_int32 ThaiLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool /*rightToLeft*/, >> +- LEGlyphStorage &glyphStorage, LEErrorCode &success) >> ++le_int32 ThaiLayoutEngine::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool /*rightToLeft*/, LEGlyphStorage &glyphStorage, LEErrorCode &success) >> + { >> + if (LE_FAILURE(success)) { >> + return 0; >> + } >> + >> +- if (chars == NULL || offset < 0 || count < 0 || max < 0 || >> +- offset >= max || offset + count > max) { >> ++ if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) { >> + success = LE_ILLEGAL_ARGUMENT_ERROR; >> + return 0; >> + } >> +@@ -107,8 +107,7 @@ >> + return 0; >> + } >> + >> +- glyphCount = ThaiShaping::compose(chars, offset, count, fGlyphSet, fErrorChar, >> +- outChars, glyphStorage); >> ++ glyphCount = ThaiShaping::compose(chars, offset, count, fGlyphSet, fErrorChar, outChars, glyphStorage); >> + mapCharsToGlyphs(outChars, 0, glyphCount, FALSE, FALSE, glyphStorage, success); >> + >> + LE_DELETE_ARRAY(outChars); >> +@@ -116,3 +115,5 @@ >> + glyphStorage.adoptGlyphCount(glyphCount); >> + return glyphCount; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiLayoutEngine.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiLayoutEngine.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -39,6 +39,8 @@ >> + >> + #include "ThaiShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + /** >> +@@ -66,8 +68,7 @@ >> + * >> + * @internal >> + */ >> +- ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, >> +- le_int32 languageCode, le_int32 typoFlags); >> ++ ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags); >> + >> + /** >> + * The destructor, virtual for correct polymorphic invocation. >> +@@ -76,6 +77,20 @@ >> + */ >> + virtual ~ThaiLayoutEngine(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + protected: >> + /** >> + * A small integer indicating which Thai encoding >> +@@ -109,10 +124,8 @@ >> + * @param offset - the index of the first character to process >> + * @param count - the number of characters to process >> + * @param max - the number of characters in the input context >> +- * @param rightToLeft - TRUE if the text is in a >> +- * right to left directional run >> +- * @param glyphStorage - the glyph storage object. The glyph and >> +- * char index arrays will be set. >> ++ * @param rightToLeft - TRUE if the text is in a right to left directional run >> ++ * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set. >> + * >> + * Output parameters: >> + * @param success - set to an error code if the operation fails >> +@@ -123,10 +136,11 @@ >> + * >> + * @internal >> + */ >> +- virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, >> +- le_int32 count, le_int32 max, le_bool rightToLeft, >> ++ virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, >> + LEGlyphStorage &glyphStorage, LEErrorCode &success); >> + >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiShaping.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiShaping.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiShaping.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -35,6 +35,8 @@ >> + #include "LEGlyphStorage.h" >> + #include "ThaiShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + enum { >> + CH_SPACE = 0x0020, >> + CH_YAMAKKAN = 0x0E4E, >> +@@ -248,9 +250,8 @@ >> + return transition.nextState; >> + } >> + >> +-le_uint8 ThaiShaping::getNextState(LEUnicode ch, le_uint8 prevState, le_int32 inputIndex, >> +- le_uint8 glyphSet, LEUnicode errorChar, >> +- le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex) >> ++le_uint8 ThaiShaping::getNextState(LEUnicode ch, le_uint8 prevState, le_int32 inputIndex, le_uint8 glyphSet, LEUnicode errorChar, >> ++ le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex) >> + { >> + StateTransition transition; >> + >> +@@ -327,3 +328,5 @@ >> + >> + return outputIndex; >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiShaping.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiShaping.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiShaping.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,13 +32,20 @@ >> + #ifndef __THAISHAPING_H >> + #define __THAISHAPING_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEGlyphFilter.h" >> + #include "OpenTypeTables.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> +-class ThaiShaping { >> ++class ThaiShaping /* not : public UObject because all methods are static */ { >> + public: >> + >> + enum { >> +@@ -120,4 +127,7 @@ >> + return thaiStateTable[state][currClass]; >> + } >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ThaiStateTables.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ThaiStateTables.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ThaiStateTables.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -25,6 +25,7 @@ >> + >> + /* >> + * >> ++ * >> + * (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved >> + * >> + * WARNING: THIS FILE IS MACHINE GENERATED. DO NOT HAND EDIT IT UNLESS >> +@@ -35,6 +36,8 @@ >> + #include "LETypes.h" >> + #include "ThaiShaping.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + const le_uint8 ThaiShaping::classTable[] = { >> + // 0 1 2 3 4 5 6 7 8 9 A B C D E F >> + // ------------------------------------------------------------------------------- >> +@@ -105,3 +108,5 @@ >> + /*50*/ {{ 0, tA}, { 1, tA}, {18, tA}, {35, tA}, { 0, tA}, { 0, tS}, { 0, tS}, { 0, tA}, { 0, tR}, { 0, tR}, { 0, tR}, {51, tC}, { 0, tR}, { 0, tC}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}}, >> + /*51*/ {{ 0, tA}, { 1, tA}, {18, tA}, {35, tA}, { 0, tA}, { 0, tS}, { 0, tA}, { 0, tA}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}, { 0, tR}} >> + }; >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -38,6 +38,10 @@ >> + #include "LEGlyphStorage.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> ++UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TrimmedArrayProcessor) >> ++ >> + TrimmedArrayProcessor::TrimmedArrayProcessor() >> + { >> + } >> +@@ -72,3 +76,5 @@ >> + } >> + } >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/TrimmedArrayProcessor.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/TrimmedArrayProcessor.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,12 +32,19 @@ >> + #ifndef __TRIMMEDARRAYPROCESSOR_H >> + #define __TRIMMEDARRAYPROCESSOR_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "MorphTables.h" >> + #include "SubtableProcessor.h" >> + #include "NonContextualGlyphSubst.h" >> + #include "NonContextualGlyphSubstProc.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + class LEGlyphStorage; >> + >> + class TrimmedArrayProcessor : public NonContextualGlyphSubstitutionProcessor >> +@@ -49,6 +56,20 @@ >> + >> + virtual ~TrimmedArrayProcessor(); >> + >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for the actual class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ virtual UClassID getDynamicClassID() const; >> ++ >> ++ /** >> ++ * ICU "poor man's RTTI", returns a UClassID for this class. >> ++ * >> ++ * @stable ICU 2.8 >> ++ */ >> ++ static UClassID getStaticClassID(); >> ++ >> + private: >> + TrimmedArrayProcessor(); >> + >> +@@ -56,6 +77,9 @@ >> + TTGlyphID firstGlyph; >> + TTGlyphID lastGlyph; >> + const TrimmedArrayLookupTable *trimmedArrayLookupTable; >> ++ >> + }; >> + >> ++U_NAMESPACE_END >> + #endif >> ++ >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ValueRecords.cpp >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ValueRecords.cpp Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ValueRecords.cpp Tue Sep 29 14:06:13 2009 -0700 >> +@@ -37,6 +37,8 @@ >> + #include "GlyphIterator.h" >> + #include "LESwaps.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + #define Nibble(value, nibble) ((value >> (nibble * 4)) & 0xF) >> + #define NibbleBits(value, nibble) (bitsInNibble[Nibble(value, nibble)]) >> + >> +@@ -161,8 +163,8 @@ >> + xPlacementAdjustment, yPlacementAdjustment, xAdvanceAdjustment, yAdvanceAdjustment); >> + } >> + >> +-void ValueRecord::adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, >> +- GlyphIterator &glyphIterator, const LEFontInstance *fontInstance) const >> ++void ValueRecord::adjustPosition(le_int16 index, ValueFormat valueFormat, const char *base, GlyphIterator &glyphIterator, >> ++ const LEFontInstance *fontInstance) const >> + { >> + float xPlacementAdjustment = 0; >> + float yPlacementAdjustment = 0; >> +@@ -323,3 +325,5 @@ >> + >> + return getFieldCount(valueFormat & beforeMasks[field]); >> + } >> ++ >> ++U_NAMESPACE_END >> +diff -r 27d58a02bb9d -r c74d38ef118c src/share/native/sun/font/layout/ValueRecords.h >> +--- openjdk.orig/jdk/src/share/native/sun/font/layout/ValueRecords.h Mon Sep 28 11:52:22 2009 -0700 >> ++++ openjdk/jdk/src/share/native/sun/font/layout/ValueRecords.h Tue Sep 29 14:06:13 2009 -0700 >> +@@ -32,11 +32,18 @@ >> + #ifndef __VALUERECORDS_H >> + #define __VALUERECORDS_H >> + >> ++/** >> ++ * \file >> ++ * \internal >> ++ */ >> ++ >> + #include "LETypes.h" >> + #include "LEFontInstance.h" >> + #include "OpenTypeTables.h" >> + #include "GlyphIterator.h" >> + >> ++U_NAMESPACE_BEGIN >> ++ >> + typedef le_uint16 ValueFormat; >> + typedef le_int16 ValueRecordField; >> + >> +@@ -84,5 +91,7 @@ >> + vfbAnyDevice = vfbXPlaDevice + vfbYPlaDevice + vfbXAdvDevice + vfbYAdvDevice >> + }; >> + >> ++U_NAMESPACE_END >> ++#endif >> + >> +-#endif >> ++ > > From ahughes at redhat.com Fri Jun 1 05:25:38 2012 From: ahughes at redhat.com (Dr Andrew John Hughes) Date: Fri, 1 Jun 2012 13:25:38 +0100 Subject: [PATCH] Introduced --with-gtk option for configure.ac In-Reply-To: <4FC730C0.8030901@redhat.com> References: <4FC730C0.8030901@redhat.com> Message-ID: <20120601122338.GB10601@rivendell.middle-earth.co.uk> On 10:50 Thu 31 May , Peter Hatina wrote: > On 05/30/2012 04:54 PM, Andrew Hughes wrote: > > > > > > ----- Original Message ----- > >> Hi, > >> > >> I fixed the diff to meet Andrew Hughes suggestions. Hope, it's OK > >> now. > >> > >> Peter Hatina > >> EMEA ENG-Desktop Development > >> Red Hat Czech, Brno > >> > >> --- > >> ChangeLog | 8 ++++++++ > >> NEWS | 1 + > >> acinclude.m4 | 54 > >> +++++++++++++++++++++++++++++++++++++++++++++++++++++- > >> 3 files changed, 62 insertions(+), 1 deletion(-) > >> > >> diff --git a/ChangeLog b/ChangeLog > >> index 82c0feb..d6f7e0c 100644 > >> --- a/ChangeLog > >> +++ b/ChangeLog > >> @@ -1,3 +1,11 @@ > >> +2012-05-28 Peter Hatina > >> + > >> + Introduced configure option --with-gtk=2.0|3.0 to be able to > >> compile > >> + against different version of GTK+ (2.x or 3.x). > >> + *NEWS: mentioned bug fix > >> + *acinclude.m4: (GTK_SET_CXX_VARS) macro for settings GTK+ CFLAGS > >> + (GTK_CHECK) macro for checking GTK+ version > >> + > >> 2012-05-02 Jiri Vanek > >> > >> Introduced new annotations Bug (to connect test/reproducer with > >> documentation) > >> diff --git a/NEWS b/NEWS > >> index 8397639..30eb055 100644 > >> --- a/NEWS > >> +++ b/NEWS > >> @@ -16,6 +16,7 @@ New in release 1.3 (2012-XX-XX): > >> - PR895: IcedTea-Web searches for missing classes on each > >> loadClass or findClass > >> * Common > >> - PR918: java applet windows uses a low resulution black/white > >> icon > >> + - RHX720836: project can be compiled against GTK+ 2 or 3 libraries > >> > >> New in release 1.2 (2011-XX-XX): > >> * Security updates: > >> diff --git a/acinclude.m4 b/acinclude.m4 > >> index a330d0f..5b801eb 100644 > >> --- a/acinclude.m4 > >> +++ b/acinclude.m4 > >> @@ -359,13 +359,65 @@ AC_ARG_ENABLE([plugin], > >> AC_MSG_RESULT(${enable_plugin}) > >> ]) > >> > >> +dnl GTK_CHECK_VERSION([gtk version], [ACTION-IF-FOUND], > >> [ACTION-IF-NOT]) > >> +AC_DEFUN([GTK_CHECK_VERSION], > >> +[ > >> + if $PKG_CONFIG --modversion gtk+-$1.0 &> /dev/null; then > >> + $2 > >> + else > >> + $3 > >> + fi > >> +]) > >> + > >> +dnl ITW_GTK_SET_CXX_VARS([gtk version]) > >> +AC_DEFUN([ITW_GTK_SET_CXX_VARS], > >> +[ > >> + GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-$1.0` > >> + GTK_LIBS=`$PKG_CONFIG --libs gtk+-$1.0` > >> +]) > >> + > >> +dnl ITW_GTK_CHECK([gtk version]) > >> +AC_DEFUN([ITW_GTK_CHECK], > >> +[ > >> + AC_CACHE_CHECK([for GTK+], [gtk_cv_version], > >> + [ > >> + case "$1" in > >> + default) > >> + GTK_CHECK_VERSION(["3"], > >> + [echo -n `$PKG_CONFIG --modversion gtk+-3.0` > >> + ITW_GTK_SET_CXX_VARS(["3"])], > >> + [GTK_CHECK_VERSION(["2"], > >> + [echo -n `$PKG_CONFIG --modversion gtk+-2.0` > >> + ITW_GTK_SET_CXX_VARS(["2"])], > >> + [AC_MSG_RESULT([no]) > >> + AC_MSG_ERROR([GTK+ not found])])]) > >> + ;; > >> + *) > >> + GTK_CHECK_VERSION([$1], > >> + [echo -n `$PKG_CONFIG --modversion gtk+-$1.0` > >> + ITW_GTK_SET_CXX_VARS([$1])], > >> + [AC_MSG_RESULT([no]) > >> + AC_MSG_ERROR([GTK+ $1 not found])]) > >> + ;; > >> + esac > >> + ]) > >> +]) > >> + > >> AC_DEFUN_ONCE([IT_CHECK_PLUGIN_DEPENDENCIES], > >> [ > >> dnl Check for plugin support headers and libraries. > >> dnl FIXME: use unstable > >> AC_REQUIRE([IT_CHECK_PLUGIN]) > >> if test "x${enable_plugin}" = "xyes" ; then > >> - PKG_CHECK_MODULES(GTK, gtk+-2.0) > >> + AC_ARG_WITH([gtk], > >> + [AS_HELP_STRING([--with-gtk=[2|3|default]], > >> + [the GTK+ version to use (default: 3)])], > >> + [case "$with_gtk" in > >> + 2|3|default) ;; > >> + *) AC_MSG_ERROR([invalid GTK+ version specified]) ;; > >> + esac], > >> + [with_gtk=default]) > >> + ITW_GTK_CHECK([$with_gtk]) > >> PKG_CHECK_MODULES(GLIB, glib-2.0) > >> AC_SUBST(GLIB_CFLAGS) > >> AC_SUBST(GLIB_LIBS) > >> -- > >> 1.7.10.2 > >> > >> > > > > No. I said it should be using the PKG_CHECK_MODULES macro from > > pkgconfig as before, not just $PKG_CONFIG. That was just an example > > of one of the features you lost in changing this. > > I decided to use $PKG_CONFIG directly to have the output of configure > script as following: > > "checking for GTK+... 3.4.3" > > If I use PKG_CHECK_MODULES, then I get: > > "checking for GTK+... yes" > > Which does not tell me, what GTK+ libraries will be used for > compilation. Especially in the case, when you do not explicitly specify > --with-gtk=blabla. So if you know about any other way, how to achieve > this, please, show me. I've been looking for this and haven't found > anything useful. That's the only reason, I used $PKG_CONFIG. > > regards, > > -- > Peter Hatina > EMEA ENG-Desktop Development > Red Hat Czech, Brno In exactly the same way you do now. It's already *you* providing that output in: > >> + [GTK_CHECK_VERSION(["2"], > >> + [echo -n `$PKG_CONFIG --modversion gtk+-2.0` > >> + ITW_GTK_SET_CXX_VARS(["2"])], > >> + [AC_MSG_RESULT([no]) > >> + AC_MSG_ERROR([GTK+ not found])])]) > >> + ;; PKG_CHECK_MODULES(GTK, gtk+-2.0, AC_MSG_CHECKING([which Gtk+ version was found]); GTK_VER=`$PKG_CONFIG --modversion gtk+-2.0`; AC_MSG_RESULT([$GTK_VER])) You shouldn't be using a bare echo anyway as this wouldn't reach the logs. I think I've written about half the patch for you now... -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/e631398a/attachment.bin From ptisnovs at icedtea.classpath.org Fri Jun 1 05:49:19 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 01 Jun 2012 12:49:19 +0000 Subject: /hg/MauveTestCoverage: Fixed an issue which happens in the compu... Message-ID: changeset 6fb52e29ed29 in /hg/MauveTestCoverage details: http://icedtea.classpath.org/hg/MauveTestCoverage?cmd=changeset;node=6fb52e29ed29 author: Pavel Tisnovsky date: Fri Jun 01 14:51:50 2012 +0200 Fixed an issue which happens in the computation of test coverage in cases the test called some ancestor method(s). diffstat: ChangeLog | 6 ++++++ src/ReportGenerator.java | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 4 deletions(-) diffs (90 lines): diff -r 8d326a855021 -r 6fb52e29ed29 ChangeLog --- a/ChangeLog Thu May 24 16:55:09 2012 +0200 +++ b/ChangeLog Fri Jun 01 14:51:50 2012 +0200 @@ -1,3 +1,9 @@ +2012-06-01 Pavel Tisnovsky + + * src/ReportGenerator.java: + Fixed an issue which happens in the computation of test coverage in + cases the test called some ancestor method(s). + 2012-05-24 Pavel Tisnovsky * src/ReportGenerator.java: diff -r 8d326a855021 -r 6fb52e29ed29 src/ReportGenerator.java --- a/src/ReportGenerator.java Thu May 24 16:55:09 2012 +0200 +++ b/src/ReportGenerator.java Fri Jun 01 14:51:50 2012 +0200 @@ -226,7 +226,7 @@ // compute number of classes covered by tests final int testedClassesCnt = numberOfTestedClassesInPackage(packageName, testedClasses, classInfoMap); // -> in percent - final float classPercentage = allClassesCnt == 0 ? 0.0f : 100.0f * testedClassesCnt / allClassesCnt; + final float classPercentage = computePercentage(allClassesCnt, testedClassesCnt); // table row background color is based on percentual test coverage ration String backgroundColor1 = generateTableRowBackground(classPercentage); @@ -242,7 +242,7 @@ coveragedMethodsCnt += classInfo.getTestedMethods().size(); } } - float methodsPercentage = allMethodsCnt == 0 ? 0.0f : 100.0f * coveragedMethodsCnt / allMethodsCnt; + final float methodsPercentage = computePercentage(allMethodsCnt, coveragedMethodsCnt); // table row background color is based on percentual test coverage ration String backgroundColor2 = generateTableRowBackground(methodsPercentage); @@ -413,7 +413,7 @@ // compute number of methods covered by tests final int testedMethodsCnt = testedMethods.size(); // -> in percent - final float percentage = 100.0f*testedMethodsCnt / allMethodsCnt; + final float percentage = computePercentage(allMethodsCnt, testedMethodsCnt); // construct CSS class for given row based on a code coverage final long coverage = Math.round(Math.ceil(percentage / 10.0f) * 10); @@ -430,6 +430,30 @@ } /** + * Compute number of methods covered by tests + * + * @param allMethodsCnt + * number of all methods in a class + * @param testedMethodsCnt + * number of tested methods + * @return test coverage in percents (0..100) + */ + private static float computePercentage(final int allMethodsCnt, final int testedMethodsCnt) + { + // avoid division by zero + if (allMethodsCnt == 0) + { + return 0.0f; + } + // we tested some methods which are part of class ancestor(s) + if (testedMethodsCnt >= allMethodsCnt) + { + return 100.0f; + } + return 100.0f * testedMethodsCnt / allMethodsCnt; + } + + /** * Create new HTML file containing report for one tested class. * * @param reportDirectory @@ -668,7 +692,14 @@ @SuppressWarnings("boxing") private static String calcRatio(int numberOfTestedItems, int numberOfAllItems) { - float ratio = 100.0f * numberOfTestedItems / numberOfAllItems; + float ratio = computePercentage(numberOfAllItems, numberOfTestedItems); + // sometimes the ratio could be greater than 100% + // one such case is a calling some method defined in the + // parent of tested class + if (ratio > 100.0f) + { + ratio = 100.0f; + } return String.format("%.2f%%", ratio); } From ptisnovs at icedtea.classpath.org Fri Jun 1 07:19:48 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Fri, 01 Jun 2012 14:19:48 +0000 Subject: /hg/gfx-test: * src/org/gfxtest/testsuites/PrintTestLines.java: Message-ID: changeset fae3942e5a44 in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=fae3942e5a44 author: Pavel Tisnovsky date: Fri Jun 01 16:22:21 2012 +0200 * src/org/gfxtest/testsuites/PrintTestLines.java: Added six new tests to this test suite. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/PrintTestLines.java | 249 ++++++++++++++++++++++++- 2 files changed, 245 insertions(+), 9 deletions(-) diffs (355 lines): diff -r 4fab4e61a60a -r fae3942e5a44 ChangeLog --- a/ChangeLog Mon May 28 11:20:35 2012 +0200 +++ b/ChangeLog Fri Jun 01 16:22:21 2012 +0200 @@ -1,3 +1,8 @@ +2012-06-01 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/PrintTestLines.java: + Added six new tests to this test suite. + 2012-05-28 Pavel Tisnovsky * src/org/gfxtest/testsuites/PrintTestCircles.java: diff -r 4fab4e61a60a -r fae3942e5a44 src/org/gfxtest/testsuites/PrintTestLines.java --- a/src/org/gfxtest/testsuites/PrintTestLines.java Mon May 28 11:20:35 2012 +0200 +++ b/src/org/gfxtest/testsuites/PrintTestLines.java Fri Jun 01 16:22:21 2012 +0200 @@ -360,7 +360,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_BUTT. - * Join style is set bevel style. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -398,7 +398,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_ROUND. - * Join style is set bevel style. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -436,7 +436,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE. - * Join style is set bevel style. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -474,7 +474,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_BUTT. - * Join style is set miter style. + * Join style is set to miter style. * Color of all rendered lines are set to black. * * @param image @@ -512,7 +512,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_ROUND. - * Join style is set miter style. + * Join style is set to miter style. * Color of all rendered lines are set to black. * * @param image @@ -550,7 +550,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE. - * Join style is set miter style. + * Join style is set to miter style. * Color of all rendered lines are set to black. * * @param image @@ -588,7 +588,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_BUTT. - * Join style is set round style. + * Join style is set to round style. * Color of all rendered lines are set to black. * * @param image @@ -626,7 +626,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_ROUND. - * Join style is set round style. + * Join style is set to round style. * Color of all rendered lines are set to black. * * @param image @@ -664,7 +664,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Horizontal lines are rendered with various width and end caps set to CAP_SQUARE. - * Join style is set round style. + * Join style is set to round style. * Color of all rendered lines are set to black. * * @param image @@ -831,6 +831,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Vertical lines are rendered with various width and end caps set to CAP_BUTT. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -868,6 +869,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Vertical lines are rendered with various width and end caps set to CAP_ROUND. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -905,6 +907,7 @@ /** * Test basic behavior of method Graphics.drawLine(). * Vertical lines are rendered with various width and end caps set to CAP_SQUARE. + * Join style is set to bevel style. * Color of all rendered lines are set to black. * * @param image @@ -940,6 +943,234 @@ } /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_BUTT. + * Join style is set to miter style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapButtJoinMiter(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_ROUND. + * Join style is set to miter style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapRoundJoinMiter(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_SQUARE. + * Join style is set to miter style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapSquareJoinMiter(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_BUTT. + * Join style is set to round style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapButtJoinRound(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_ROUND. + * Join style is set to round style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapRoundJoinRound(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawLine(). + * Vertical lines are rendered with various width and end caps set to CAP_SQUARE. + * Join style is set to round style. + * Color of all rendered lines are set to black. + * + * @param image + * image to which lines are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawVerticalLinesChangeWidthCapSquareJoinRound(TestImage image, Graphics2D graphics) + { + drawVerticalLines(image, graphics, HORIZONTAL_STEP << 1, new VerticalLineDrawCallbacks() + { + /** + * Stroke width. + */ + float strokeWidth = 0.0f; + + /** + * Callback function called before each line is rendered. + */ + @Override + public void iterationCallBack(int x, int index) + { + // set stroke width + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND)); + // set new stroke width + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + STROKE_WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** * Entry point to the test suite. * * @param args not used in this case From bugzilla-daemon at icedtea.classpath.org Fri Jun 1 07:32:12 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Jun 2012 14:32:12 +0000 Subject: [Bug 1022] New: SEGV when closing a Deflater in a finalizer Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1022 Priority: P3 Bug ID: 1022 Assignee: unassigned at icedtea.classpath.org Summary: SEGV when closing a Deflater in a finalizer Severity: critical Classification: Unclassified OS: Linux Reporter: mike at bfo.co.uk Hardware: x86 Status: NEW Version: 6-1.11.1 Component: IcedTea Product: IcedTea Created attachment 699 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=699&action=edit log The below code will cause a segv every time - it works in the Sun JVM at least up to 1.6.0_29 and also in OpenJDK 7. Problematic frame is "[libjvm.so+0x4cfc43] jni_GetByteArrayRegion+0x83", and the hserr is attached. import java.util.zip.*; import java.io.*; public class Test { OutputStream out; Test() throws IOException { out = new DeflaterOutputStream(new ByteArrayOutputStream()); } protected void finalize() throws IOException { out.close(); } public static void main(String[] args) throws Exception { Test t = new Test(); t = null; System.gc(); } } -- You are receiving this mail because: You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/149c8f37/attachment.html From adomurad at redhat.com Fri Jun 1 07:45:21 2012 From: adomurad at redhat.com (Adam Domurad) Date: Fri, 01 Jun 2012 10:45:21 -0400 Subject: [rfc][icedtea-web] Reproducer for: Ignore invalid .jar files in applets In-Reply-To: <1338236601.24497.11.camel@voip-10-15-18-79.yyz.redhat.com> References: <1338233214.24497.8.camel@voip-10-15-18-79.yyz.redhat.com> <1338236601.24497.11.camel@voip-10-15-18-79.yyz.redhat.com> Message-ID: <1338561921.24497.45.camel@voip-10-15-18-79.yyz.redhat.com> Here's is a reproducer for the previous patch (which still needs a reviewer btw). ChangeLog: 2012-06-01 Adam Domurad * tests/jnlp_tests/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.html: * tests/jnlp_tests/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnlp: * tests/jnlp_tests/simple/AppletReadsInvalidJar/srcs/Valid.java: * tests/jnlp_tests/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java: Reproducer for checking behaviour of existing but invalid (corrupt, etc) jar files in .jnlp files (should fail) and applet tags (should be ignored) On Mon, 2012-05-28 at 16:23 -0400, Adam Domurad wrote: > The original patch actually errors when passed a .jar file that simply > does not exist. This is a better patch. > > ChangeLog: > 2012-05-28 Adam Domurad > > Ignore invalid jar files in applets, like the oracle plugin does. > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: > (isInvalidJar): New, checks for ZipException in new JarFile(...) > (shouldFilterInvalidJars): New, checks if we are in an applet > (initializeResources): if 'shouldFilterInvalidJars()' is true and a jar > is not a valid jar file, the jar is filtered out and normal execution > continues. > > > > On Mon, 2012-05-28 at 15:26 -0400, Adam Domurad wrote: > > Hey all. Second try at a patch to ignore invalid .jar files, this time > > only affecting applets (ie, not pages that use jnlp_href). > > > > The proprietary plug-in seems to just skip over any malformed .jar files > > and carry on loading in, while in applets. This patch emulates that > > behaviour. Pages with jnlp_href still crash with a ZipException on jar > > verification (the proprietary plugin also fatally errors). > > > > This alleviates some of the symptoms of > > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1011 > > Once this patch has been accepted in some form, I hope to make it so > > that the plugin will parse folders differently than jar files and look > > for resources in folders like the proprietary plug-in does. > > > > Le ChangeLog: > > 2012-05-28 Adam Domurad > > > > Ignore invalid jar files in applets, like the oracle plugin does. > > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: > > (isValidJar): New, checks for ZipException in new JarFile(...) > > (shouldIgnoreInvalidJars): New, checks if we are in an applet > > (initializeResources): if 'shouldIgnoreInvalidJars()' is true and a jar > > is not a valid jar file, the jar is filtered out and normal execution > > continues. > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: ignore-invalid-jar-files-reproducers.patch Type: text/x-patch Size: 10537 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/686a7004/ignore-invalid-jar-files-reproducers.patch From dbhole at icedtea.classpath.org Fri Jun 1 13:05:24 2012 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Fri, 01 Jun 2012 20:05:24 +0000 Subject: /hg/icedtea-web: Fixed PR863: Error passing strings to applet me... Message-ID: changeset 8c087e1b5c6b in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=8c087e1b5c6b author: Deepak Bhole date: Fri Jun 01 16:05:18 2012 -0400 Fixed PR863: Error passing strings to applet methods in Chromium diffstat: ChangeLog | 13 +++++++++++++ NEWS | 1 + plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 4 ++-- plugin/icedteanp/IcedTeaNPPlugin.cc | 12 ++++++++++-- plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 4 ++-- plugin/icedteanp/IcedTeaPluginUtils.cc | 12 ++++++------ 6 files changed, 34 insertions(+), 12 deletions(-) diffs (137 lines): diff -r d302c51bd619 -r 8c087e1b5c6b ChangeLog --- a/ChangeLog Wed May 30 13:36:41 2012 +0200 +++ b/ChangeLog Fri Jun 01 16:05:18 2012 -0400 @@ -1,3 +1,16 @@ +2012-06-01 Deepak Bhole + + PR863: Error passing strings to applet methods in Chromium + * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc + (createJavaObjectFromVariant): Account for length of the characters. + * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): Same. + * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (_eval): Print the + string's c_str rather than utf8characters/ + * plugin/icedteanp/IcedTeaPluginUtils.cc (printNPVariant): Account for + length of the characters. + (NPVariantToString): Same. + (isObjectJSArray): Same. + 2012-05-30 Jiri Vanek Enabled multiple certificates and extracted variables diff -r d302c51bd619 -r 8c087e1b5c6b NEWS --- a/NEWS Wed May 30 13:36:41 2012 +0200 +++ b/NEWS Fri Jun 01 16:05:18 2012 -0400 @@ -14,6 +14,7 @@ - PR811: javaws is not handling urls with spaces (and other characters needing encoding) correctly * Plugin - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp + - PR863: Error passing strings to applet methods in Chromium - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass * Common - PR918: java applet windows uses a low resulution black/white icon diff -r d302c51bd619 -r 8c087e1b5c6b plugin/icedteanp/IcedTeaJavaRequestProcessor.cc --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Wed May 30 13:36:41 2012 +0200 +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Fri Jun 01 16:05:18 2012 -0400 @@ -905,9 +905,9 @@ { className = "java.lang.String"; #if MOZILLA_VERSION_COLLAPSED < 1090200 - stringArg += NPVARIANT_TO_STRING(variant).utf8characters; + stringArg.append(NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); #else - stringArg += NPVARIANT_TO_STRING(variant).UTF8Characters; + stringArg.append(NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); #endif } else if (NPVARIANT_IS_OBJECT(variant)) { diff -r d302c51bd619 -r 8c087e1b5c6b plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Wed May 30 13:36:41 2012 +0200 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Jun 01 16:05:18 2012 -0400 @@ -1094,11 +1094,16 @@ href_id, &href); // Strip everything after the last "/" + char *href_str; #if MOZILLA_VERSION_COLLAPSED < 1090200 - gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).utf8characters, "/", -1); + href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).utf8length + 1); + snprintf(href_str, NPVARIANT_TO_STRING(href).utf8length+1, "%s", NPVARIANT_TO_STRING(href).utf8characters); #else - gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).UTF8Characters, "/", -1); + href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).UTF8Length + 1); + snprintf(href_str, NPVARIANT_TO_STRING(href).UTF8Length+1, "%s", NPVARIANT_TO_STRING(href).UTF8Characters); #endif + + gchar** parts = g_strsplit (href_str, "/", -1); guint parts_sz = g_strv_length (parts); std::string location_str; @@ -1113,6 +1118,9 @@ // Release references. browser_functions.releasevariantvalue(&href); browser_functions.releasevariantvalue(&location); + g_strfreev(parts); + free(href_str); + href_str = NULL; cleanup_done: PLUGIN_DEBUG ("plugin_get_documentbase return\n"); PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy); diff -r d302c51bd619 -r 8c087e1b5c6b plugin/icedteanp/IcedTeaPluginRequestProcessor.cc --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Wed May 30 13:36:41 2012 +0200 +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc Fri Jun 01 16:05:18 2012 -0400 @@ -842,12 +842,12 @@ script.utf8characters = script_str->c_str(); script.utf8length = script_str->size(); - PLUGIN_DEBUG("Evaluating: %s\n", script.utf8characters); + PLUGIN_DEBUG("Evaluating: %s\n", script_str->c_str()); #else script.UTF8Characters = script_str->c_str(); script.UTF8Length = script_str->size(); - PLUGIN_DEBUG("Evaluating: %s\n", script.UTF8Characters); + PLUGIN_DEBUG("Evaluating: %s\n", script_str->c_str()); #endif ((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_variant); diff -r d302c51bd619 -r 8c087e1b5c6b plugin/icedteanp/IcedTeaPluginUtils.cc --- a/plugin/icedteanp/IcedTeaPluginUtils.cc Wed May 30 13:36:41 2012 +0200 +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Fri Jun 01 16:05:18 2012 -0400 @@ -662,9 +662,9 @@ else if (NPVARIANT_IS_STRING(variant)) { #if MOZILLA_VERSION_COLLAPSED < 1090200 - PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).utf8characters); + PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); #else - PLUGIN_DEBUG("STRING: %s\n", NPVARIANT_TO_STRING(variant).UTF8Characters); + PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); #endif } else @@ -704,11 +704,11 @@ else if (NPVARIANT_IS_STRING(variant)) { #if MOZILLA_VERSION_COLLAPSED < 1090200 - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).utf8length; + size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).utf8length+1; largestr = (char*) malloc(buffersize); snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).utf8characters); #else - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).UTF8Length; + size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).UTF8Length+1; largestr = (char*) malloc(buffersize); snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).UTF8Characters); #endif @@ -864,9 +864,9 @@ std::string constructor_name = std::string(); #if MOZILLA_VERSION_COLLAPSED < 1090200 - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).utf8characters); + constructor_name.append(NPVARIANT_TO_STRING(constructor_str).utf8characters, NPVARIANT_TO_STRING(constructor_str).utf8length); #else - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters); + constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters, NPVARIANT_TO_STRING(constructor_str).UTF8Length); #endif PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str()); From bugzilla-daemon at icedtea.classpath.org Fri Jun 1 13:05:33 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Jun 2012 20:05:33 +0000 Subject: [Bug 863] Error passing strings to applet methods in Chromium In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=863 --- Comment #3 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=8c087e1b5c6b author: Deepak Bhole date: Fri Jun 01 16:05:18 2012 -0400 Fixed PR863: Error passing strings to applet methods in Chromium -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/5f1889c3/attachment.html From bugzilla-daemon at icedtea.classpath.org Fri Jun 1 13:06:14 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Jun 2012 20:06:14 +0000 Subject: [Bug 861] Code in a jar cannot connect to jar host server In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 Deepak Bhole changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Deepak Bhole --- Fixed in HEAD. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/e0399f2d/attachment.html From bugzilla-daemon at icedtea.classpath.org Fri Jun 1 13:06:27 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Fri, 01 Jun 2012 20:06:27 +0000 Subject: [Bug 863] Error passing strings to applet methods in Chromium In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=863 Deepak Bhole changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Deepak Bhole --- Fixed in HEAD. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120601/f262b076/attachment.html From dbhole at icedtea.classpath.org Fri Jun 1 13:44:38 2012 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Fri, 01 Jun 2012 20:44:38 +0000 Subject: /hg/icedtea-web: Fixed minor typo in ChangeLog Message-ID: changeset 73f6e7fd1446 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=73f6e7fd1446 author: Deepak Bhole date: Fri Jun 01 16:44:32 2012 -0400 Fixed minor typo in ChangeLog diffstat: ChangeLog | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 8c087e1b5c6b -r 73f6e7fd1446 ChangeLog --- a/ChangeLog Fri Jun 01 16:05:18 2012 -0400 +++ b/ChangeLog Fri Jun 01 16:44:32 2012 -0400 @@ -5,7 +5,7 @@ (createJavaObjectFromVariant): Account for length of the characters. * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): Same. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (_eval): Print the - string's c_str rather than utf8characters/ + string's c_str rather than utf8characters. * plugin/icedteanp/IcedTeaPluginUtils.cc (printNPVariant): Account for length of the characters. (NPVariantToString): Same. From drazzib at drazzib.com Sat Jun 2 05:07:11 2012 From: drazzib at drazzib.com (Damien Raude-Morvan) Date: Sat, 2 Jun 2012 14:07:11 +0200 Subject: Zero support on HSX23 ? Message-ID: <201206021407.12103.drazzib@drazzib.com> Hi, From reading of IcedTea 2.2 release notes, it seems that Zero is not supported with current HSX 23 (and therefore ARM thumb2 work done by Andrew Haley is unavailable with 2.2). AFAIK, main problem for HSX23 was on JSR-292 support and usage of ricochet frames. Is there some repository (hg forest ?) for current work on Zero/Shark which I can, at least, take a look ? Regards, -- Damien From bayan.rafeh92 at gmail.com Sun Jun 3 08:16:22 2012 From: bayan.rafeh92 at gmail.com (Bayan Rafeh) Date: Sun, 03 Jun 2012 18:16:22 +0300 Subject: purging openJDK from Ubuntu Message-ID: Hi, I'm trying to purge openJDK from my system in Ubuntu Precise with apt-get, but it forces me to install a different version of OpenJDK every time I try to do so, so for example when I try apt-get purge openjdk-7-jre, it forces me to install openjdk 6 and vice versa. I've got a custom update-alternatives setup and this bug breaks dpkg every time I upgrade, so any help is greatly appreciated. -- Bayan Rafeh From mark at klomp.org Sun Jun 3 14:55:43 2012 From: mark at klomp.org (Mark Wielaard) Date: Sun, 03 Jun 2012 23:55:43 +0200 Subject: classpath/icedtea server updates Message-ID: <1338760543.18107.13.camel@springer.wildebeest.org> Some classpath/icedtea servers changed networks/ip addresses on Sunday. Changes should propagate through DNS on Monday. This can cause connection errors to planet.classpath.org, builder.classpath.org (buildbot and jenkins) and icedtea.wildebeest.org (hg backups). Apologies for the late notice. From weijun.wang at oracle.com Sun Jun 3 18:45:48 2012 From: weijun.wang at oracle.com (Weijun Wang) Date: Mon, 04 Jun 2012 09:45:48 +0800 Subject: purging openJDK from Ubuntu In-Reply-To: References: Message-ID: <4FCC134C.2060505@oracle.com> I'm not an expert on ubuntu's packaging system, but is it possible that you have installed java-related packages and apt-get believes you need a JDK/JRE anyway? -Max On 06/03/2012 11:16 PM, Bayan Rafeh wrote: > Hi, > > I'm trying to purge openJDK from my system in Ubuntu Precise with > apt-get, but it forces me to install a different version of OpenJDK > every time I try to do so, so for example when I try apt-get purge > openjdk-7-jre, it forces me to install openjdk 6 and vice versa. I've > got a custom update-alternatives setup and this bug breaks dpkg every > time I upgrade, so any help is greatly appreciated. > From jvanek at redhat.com Mon Jun 4 00:49:41 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 04 Jun 2012 09:49:41 +0200 Subject: [rfc][icedtea-web] Tiny patch to make last param in applet tag take effect, was first In-Reply-To: <1338492716.24497.41.camel@voip-10-15-18-79.yyz.redhat.com> References: <1338411425.24497.34.camel@voip-10-15-18-79.yyz.redhat.com> <4FC68B5C.8040106@redhat.com> <4FC68DD1.6050701@redhat.com> <4FC7141E.3030007@redhat.com> <1338492716.24497.41.camel@voip-10-15-18-79.yyz.redhat.com> Message-ID: <4FCC6895.60400@redhat.com> On 05/31/2012 09:31 PM, Adam Domurad wrote: > Gah. Always forget to group-reply. > > Here are two reproducers, one for checking that the final param is taken > in a .jnlp file (current behaviour), and one for checking that the final > param is taken in a .html file (post-patch behaviour). > > ChangeLog: > 2012-05-31 Adam Domurad > > Reproducers to ensure that equivalent parameters take the value of the > second parameter tag to occur. > * > tests/jnlp_tests/simple/AppletTakesLastParam/resources/appletTakesLastParam.html: > New, tests parameter duplication in applet-tags. > * > tests/jnlp_tests/simple/AppletTakesLastParam/resources/appletTakesLastParam.jnlp: > New, tests parameter duplication in jnlp files. > * > tests/jnlp_tests/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java: > New, reads a duplicated parameter, 'param'. > * > tests/jnlp_tests/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java: > New, drives test for duplicated param in .jnlp and .html files. > > Cheers, > Adam Hi! Thanx for reproducer. Only two tiny things, After fixed you can go ahead and push! > diff --git a/netx-dist-tests-whitelist b/netx-dist-tests-whitelist > --- a/netx-dist-tests-whitelist > +++ b/netx-dist-tests-whitelist > @@ -1,1 +1,1 @@ > -.* > +AppletTakesLastParam Definitely remove this file from changeset;) (I believe it was unintentionally added, so please be careful with unrelated changes.) + + @Test + public void AppletInFirefoxTest() throws Exception { + ServerAccess.ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html"); + pr.process.destroy(); + evaluateApplet(pr); + Assert.assertTrue(pr.wasTerminated); + } +} The "pr.process.destroy()" Is no longer necessary[1]. If you have copy-pasted it form somewhere, please can you remove it also form this source? (But ensure Thet I'm not lying ;) [1] http://icedtea.classpath.org/hg/icedtea-web/rev/16a8b7bfee7d?revcount=120 Thanx again for tests! J. > > On Thu, 2012-05-31 at 08:47 +0200, Jiri Vanek wrote: >> On 05/30/2012 11:14 PM, Omair Majid wrote: >>> On 05/30/2012 05:04 PM, Omair Majid wrote: >>>> On 05/30/2012 04:57 PM, Adam Domurad wrote: >>>>> Tiny patch to make handling of applet tags more like Oracle's plugin. >>>>> This makes our plugin take into account the last tag with >>>>> the same 'name'. It was taking into account the first such tag. >>>>> >>>>> 2012-05-30 Adam Domurad >>>>> >>>>> * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: >>>>> (parse) Small change to have last tag to >>>>> take effect. >>>> >>> >>> Btw, I would strongly encourage you to write a reproducer (or unit) test >>> for this. >>> >>> Cheers, >>> Omair >> >> Definitely. Please provide reproducer before push of this changeset. >> >> Thanx in advance, J. > > > > From jvanek at redhat.com Mon Jun 4 01:42:22 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 04 Jun 2012 10:42:22 +0200 Subject: [rfc][icedtea-web] Reproducer for: Ignore invalid .jar files in applets In-Reply-To: <1338561921.24497.45.camel@voip-10-15-18-79.yyz.redhat.com> References: <1338233214.24497.8.camel@voip-10-15-18-79.yyz.redhat.com> <1338236601.24497.11.camel@voip-10-15-18-79.yyz.redhat.com> <1338561921.24497.45.camel@voip-10-15-18-79.yyz.redhat.com> Message-ID: <4FCC74EE.2090001@redhat.com> On 06/01/2012 04:45 PM, Adam Domurad wrote: > Here's is a reproducer for the previous patch (which still needs a > reviewer btw). Thanx a lot for test! Few hint inline. > > ChangeLog: > 2012-06-01 Adam Domurad > > * > tests/jnlp_tests/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.html: > * > tests/jnlp_tests/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnlp: > * tests/jnlp_tests/simple/AppletReadsInvalidJar/srcs/Valid.java: > * > tests/jnlp_tests/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java: > Reproducer for checking behaviour of existing but invalid (corrupt, > etc) jar files in .jnlp files (should fail) and applet tags (should be > ignored) It is not clear whether the test should fail, or the test should pass with failure of application. See below for more comments on this topic. > > On Mon, 2012-05-28 at 16:23 -0400, Adam Domurad wrote: ...snip... > +exception statement from your version. > + */ > +public class Valid extends Applet { > + @Override > + public void init() { > + System.out.println("Program Executed Correctly."); > + } > +} You do not need to create such a simple application each time, but you can reuse one of the existing. But for this case we can probably live with new one (depends on you) > diff --git a/tests/jnlp_tests/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java b/tests/jnlp_tests/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java > new file mode 100644 ...snip... > + > + /*This SHOULD NOT execute the applet!*/ > + @Test > + public void AppletJNLPTest() throws Exception { > + long previous_timeout = ServerAccess.PROCESS_TIMEOUT; > + /*This test should be short, so set to 2 seconds*/ > + ServerAccess.PROCESS_TIMEOUT = 2 * 1000; > + > + ServerAccess.ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp"); > + > + String s0 = "Program Executed Correctly."; > + Assert.assertTrue("AppletTakesLastParam stdout should NOT contain " + s0 + ", but did (applet should not have ran!).", !pr.stdout.contains(s0)); > + > + ServerAccess.PROCESS_TIMEOUT = previous_timeout; > + } In this case you are launching applet in javaws. It will not launch application. Is this time outing necessary? If the applet in javaws is not laoded at all, then javaws should be terminated or not? Also there is small complex - applets should be launched _without_ hedaless, but if exception is launched in not-headless mode, then dialog-window keeps hanging n the air. If timeout is really necessary (killer thread is not enough I guess) then the restore of original one must be in finally block. Although to check the type of exception can be very handy. Last comment here - the issue is never going to be fixed (applet by jnlp) correct? In case that it should be fixed n some future, then this test should be failing (@KnownToFail) > + > + /*This SHOULD execute the applet!*/ > + @Test > + public void AppletInFirefoxTest() throws Exception { > + ServerAccess.ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html"); > + > + String s0 = "Program Executed Correctly."; > + Assert.assertTrue("AppletTakesLastParam stdout should contain " + s0 + " but did not.", pr.stdout.contains(s0)); > + } > +} Tahnx for test again! J. From jvanek at redhat.com Mon Jun 4 03:18:47 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 04 Jun 2012 12:18:47 +0200 Subject: [RFC][icedtea-web] Signed JNLP file: added regression tests In-Reply-To: <4FC7D3E0.7040202@redhat.com> References: <4FBBEA1F.6010007@redhat.com> <4FBCE9AE.5020808@redhat.com> <4FC3AFE8.1090406@redhat.com> <4FC3D21C.5090509@redhat.com> <4FC3F434.3080006@redhat.com> <4FC4868A.7020204@redhat.com> <4FC7D3E0.7040202@redhat.com> Message-ID: <4FCC8B87.7050607@redhat.com> On 05/31/2012 10:26 PM, Saad Mohammad wrote: > Hi, > > From previous reviews and suggestions, I have updated the patch which tests the launch of applications with unsigned and signed jnlp file. The test ensures that a signed jnlp file is checked/validated (if found) at launch and the appropriate actions are taken depending on the validation. > > * Changelog entry is attached. > > On a side note (and as mentioned in my previous email), Oracle's JDK validates the jnlp file (if found within jar) regardless of whether it is signed or not. But according to their specification (section 5.4): > > "A JNLP file can optionally be signed. A JNLP Client must check if a signed version of the JNLP file or JNLP template exist, and if so, verify that at least one of them match the JNLP file that is used to launch the application. If a match is not found (see below), then the launch must be aborted. If no signed JNLP file or JNLP template exist, then the JNLP file is not signed, and no check needs to be performed." > > "A JNLP file is signed either by including a copy of it in the signed main JAR file, or by including a matching (see below) template file in the signed main JAR file." > > After running some tests, I can say IcedTea-Web behaves according to the specification. I'm just curious to whether this is fine or if we would like IcedTea-Web to behave similar to Oracle's JDK. Also, because of this, the unsigned tests (included in the patch) ensures no signed jnlp file is checked (because the jar is unsigned). Any thoughts? > > Thanks. :) > Ugh. that is laaarg one.... I have just two minor issue with this patch, once fixed you can push. 1) You have (jsut few times) soemthing like: String s = ... Assert.assert*(".." + s.. In same file you have sometimes this value of s copy pasted. Can you extract it to final global variable and reuse? 2)You have spaces instead of tabs in your changelog. Be sure there are tabs before commit;) Also please cut lines (not filenames!) longer then 80chars to 80chars... aprox...O:) I have seen just 6liens worthy of this.... Thanx for tests! Overall to by-jnlp-signed apps: I remeber my question: >> Q: I thought that jnlp signing is working like this: >> 1 - (I'm unsure here) signed jar with JNLP-INF/* and unsigned jar with the (signed?) same/tempalte_matching jnlp file. >> So to test it properly you need to us two jars - signed and unsigned. And ensure that the second one obtains rights or launch terminate. >> 2 - or (more probably, but I'm still lost in this signing) just jnlp file (and few others BUT NOT whole jar) should be signed in jar and the rest is evaluated by comparison of launching jnlp and signed jnlp inside. > And reply: > 1) A signed JNLP application/template file > 2) An unsigned JNLP application/template file > 3) A signed jnlp application/template file with case > insensitive filenames > > I'm currently working on adding a few more tests that will test applications with multiple jars. These tests will be sent in another email very soon :) You wrote me that it is not necessary to include multpile jars test. But I also rember that you have tested it.. Please provide test or two to catch the behaviour. I still do not see the reason why you consider those tests as unworthy for prearation. Thanx again for testing your previous work!-) J. From jvanek at redhat.com Mon Jun 4 03:33:27 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 04 Jun 2012 12:33:27 +0200 Subject: [RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value. In-Reply-To: <4FC692E7.7000103@redhat.com> References: <4F5E69D6.9060401@redhat.com> <4F913542.5050500@redhat.com> <4FC66E9C.2080500@redhat.com> <4FC692E7.7000103@redhat.com> Message-ID: <4FCC8EF7.2030505@redhat.com> On 05/30/2012 11:36 PM, Omair Majid wrote: > On 05/30/2012 03:01 PM, Danesh Dadachanji wrote: >> >> Attached a new patch with the refactored code and a unit test. > > I have a few comments on the patch below. > >> I added a static method that just wraps around the new URL assignment. I >> couldn't figure out how to test PluginBridge directly without having it >> open an actual JNLP file. :/ I made it static to make the unit test >> cleaner (did not have to deal with creating a new PluginBridge var etc) >> since it is quite the simple method and really only serves for unit >> testing purposes. If others prefer, I can make it non-static. > > I think it's fine as long as it's implied clearly that this static > method is meant to be private (it can't be made private since it's used > in the test class). > >> diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java >> --- a/netx/net/sourceforge/jnlp/PluginBridge.java >> +++ b/netx/net/sourceforge/jnlp/PluginBridge.java >> @@ -171,6 +171,18 @@ public class PluginBridge extends JNLPFi >> codeBaseLookup = cbl == null || (Boolean.valueOf(cbl)); >> } >> >> + /** >> + * Evaluate if the location is a relative or absolute path. Use the codeBase >> + * as the URL context if it is relative. >> + * @param codeBase The URL used for context if needed. >> + * @param location The address pointing to the JNLP. >> + * @return A URL to the location of the JNLP file. >> + * @throws MalformedURLException >> + */ > > I would prefer a comment saying this method should be considered private > rather than cleanly documenting it. > >> + static URL getEvaluatedJNLPHref(URL codeBase, String location) throws MalformedURLException { >> + return new URL(codeBase, location); >> + } >> + >> public boolean codeBaseLookup() { >> return codeBaseLookup; >> } >> diff --git a/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java >> new file mode 100644 >> --- /dev/null >> +++ b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java >> @@ -0,0 +1,27 @@ >> +package net.sourceforge.jnlp; > > You are missing the license here. > >> + @Test >> + public void testAbsoluteJNLPHref() throws MalformedURLException, Exception { >> + URL codeBase = new URL("http://undesired.absolute.codebase.com"); >> + String absoluteLocation = "http://absolute.href.com/test.jnlp"; >> + assertEquals(absoluteLocation, >> + PluginBridge.getEvaluatedJNLPHref(codeBase, absoluteLocation).toExternalForm()); >> + } >> + >> + @Test >> + public void testARelativeJNLPHref() throws MalformedURLException, Exception { >> + URL codeBase = new URL("http://desired.absolute.codebase.com"); >> + String relativeLocation = "sub/dir/test.jnlp"; >> + assertEquals(codeBase + "/" + relativeLocation, >> + PluginBridge.getEvaluatedJNLPHref(codeBase, relativeLocation).toExternalForm()); >> + } >> +} > > If you want to be extra pedantic, one more test: > > URL codeBase = new URL("http://desired.absolute.codebase.com/foo"); > String relativeLocation = "/sub/dir/test.jnlp"; > > Result should be "http://desired.absolute.codebase.com/sub/dir/test.jnlp" > > But I am feeling sort of uncomfortable about this. These tests are just > testing that 'new URL(a,b)' works sanely in java. If it doesn't, then > the JVM is broken and there is nothing we can do about it. It doesn't > help us in any way if these tests pass because these tests aren't > verifying that PluginBridge uses this correct url. Although I'm sharing Omair's concerns, I think the tests for method for purpose of its future modifications and as behaviour demonstrations are enough. After fulfilling Omair's requests (including one test O:) I'm ok both with changeset and tests. Thanx both of you J. From jvanek at redhat.com Mon Jun 4 03:43:14 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Mon, 04 Jun 2012 12:43:14 +0200 Subject: [icedtea-web] RFC: Patch for PR861: Code in a jar cannot connect to jar host server In-Reply-To: <20120528171606.GP29866@redhat.com> References: <20120528171606.GP29866@redhat.com> Message-ID: <4FCC9142.8090505@redhat.com> On 05/28/2012 07:16 PM, Deepak Bhole wrote: > Hi, > > Attached patch resolves PR861: > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 > > ChangeLog: > 2012-05-28 Deepak Bhole > > PR861: Allow loading from non codebase hosts. Allow code to connect to > hosting server. > * netx/net/sourceforge/jnlp/SecurityDesc.java > (getSandBoxPermissions): Only add host if it is not empty. > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > (getPermissions): Add SocketPermission for code source host. > (findLoadedClassAll): Call super methods privileged so that connection to > non codebase hosts can be made. > (findClass): Same. > (findResourcesBySearching): Same. Also use privileged context for enum > operations because the enum is defined on the fly by URLClassLoader and > checks for hosting server connectivity via next(). > (getAccessControlContextForClassLoading): New method. Returns a control > context for classloader operations like find/load/etc. > (CodeBaseClassLoader::findClass): Call super methods privileged so that > connection to non codebase hosts can be made. > (CodeBaseClassLoader::findResource): Same. > > Applets may specify jars from different host servers. The current code only > allows socket connect permissions for codebase. This is insufficient as a class > from one jar may need a class from another jar that is hosted on a different > server. > > Furthermore, if a class comes from server foo, it should be allowed to connect > to foo throughout its lifetime. > > Attached patch resolves the above issues and makes the site mentioned in the > bug (http://broadband.mpi-sws.org/transparency/glasnost.php) work again. > > OK for HEAD? > > Cheers, > Deepak Hi! I have walked across the code and looks ok. Two questions inline. Btw - can you suggest me a bit How I can write an reproducer? There is ability in current framework to run several wirtual servers on "different urls" by different ports. So you can run application from localhost:1234 and downlaod resource from localhsot:56789. Will this be enough for this testing ( I will elaborate on this reproducers) > > > PR861.patch > > > diff -r 6df151bb5320 NEWS > --- a/NEWS Fri May 25 11:44:13 2012 -0400 > +++ b/NEWS Mon May 28 13:11:12 2012 -0400 > @@ -15,6 +15,7 @@ > * Plugin > - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp > - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass > + - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server. > * Common > - PR918: java applet windows uses a low resulution black/white icon > > diff -r 6df151bb5320 netx/net/sourceforge/jnlp/SecurityDesc.java > --- a/netx/net/sourceforge/jnlp/SecurityDesc.java Fri May 25 11:44:13 2012 -0400 > +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Mon May 28 13:11:12 2012 -0400 > @@ -238,7 +238,7 @@ > for (int i = 0; i< jnlpRIAPermissions.length; i++) > permissions.add(jnlpRIAPermissions[i]); > > - if (downloadHost != null) > + if (downloadHost != null&& downloadHost.length()> 0) > permissions.add(new SocketPermission(downloadHost, > "connect, accept")); You are adding privileges - shouldn't application request for SocketPermission itself? > > diff -r 6df151bb5320 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri May 25 11:44:13 2012 -0400 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon May 28 13:11:12 2012 -0400 > @@ -25,9 +25,11 @@ > import java.io.InputStream; > import java.io.InputStreamReader; > import java.net.MalformedURLException; > +import java.net.SocketPermission; > import java.net.URL; > import java.net.URLClassLoader; > import java.security.AccessControlContext; > +import java.security.AccessControlException; > import java.security.AccessController; > import java.security.AllPermission; > import java.security.CodeSource; > @@ -35,9 +37,12 @@ > import java.security.PermissionCollection; > import java.security.Permissions; > import java.security.PrivilegedAction; > +import java.security.PrivilegedActionException; > import java.security.PrivilegedExceptionAction; > +import java.security.ProtectionDomain; > import java.util.ArrayList; > import java.util.Arrays; > +import java.util.Collection; > import java.util.Collections; > import java.util.Enumeration; > import java.util.HashMap; > @@ -948,6 +953,11 @@ > result.add(runtimePermissions.get(i)); > } > > + // Class from host X should be allowed to connect to host X > + if (cs.getLocation().getHost().length()> 0) > + result.add(new SocketPermission(cs.getLocation().getHost(), > + "connect, accept")); > + > return result; > } catch (RuntimeException ex) { > if (JNLPRuntime.isDebug()) { > @@ -1316,10 +1326,21 @@ > for (int i = 0; i< loaders.length; i++) { > Class result = null; > > - if (loaders[i] == this) > - result = super.findLoadedClass(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + try { > + result = AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() { > + return JNLPClassLoader.super.findLoadedClass(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + result = null; > + } > + } else { > result = loaders[i].findLoadedClassAll(name); > + } > > if (result != null) > return result; > @@ -1517,12 +1538,20 @@ > protected Class findClass(String name) throws ClassNotFoundException { > for (int i = 0; i< loaders.length; i++) { > try { > - if (loaders[i] == this) > - return super.findClass(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + return AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() throws ClassNotFoundException { > + return JNLPClassLoader.super.findClass(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } else { > return loaders[i].findClass(name); > + } > } catch (ClassNotFoundException ex) { > } catch (ClassFormatError cfe) { > + } catch (PrivilegedActionException pae) { > } Although unrelated this consumed exception scares me. > } > > @@ -1631,20 +1660,42 @@ > */ > private Enumeration findResourcesBySearching(String name) throws IOException { > List resources = new ArrayList(); > - Enumeration e; > + Enumeration e = null; > > for (int i = 0; i< loaders.length; i++) { > // TODO check if this will blow up or not > // if loaders[1].getResource() is called, wont it call getResource() on > // the original caller? infinite recursion? > > - if (loaders[i] == this) > - e = super.findResources(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + try { > + e = AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Enumeration run() throws IOException { > + return JNLPClassLoader.super.findResources(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + } > + } else { > e = loaders[i].findResources(name); > + } > > - while (e.hasMoreElements()) > - resources.add(e.nextElement()); > + final Enumeration fURLEnum = e; > + try { > + resources.addAll(AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Collection run() { > + List resources = new ArrayList(); > + while (fURLEnum != null&& fURLEnum.hasMoreElements()) { > + resources.add(fURLEnum.nextElement()); > + } > + return resources; > + } > + }, getAccessControlContextForClassLoading())); > + } catch (PrivilegedActionException pae) { > + } > } > > // Add resources from codebase (only if nothing was found above, > @@ -1896,6 +1947,56 @@ > } > } > > + /** > + * Returns an appropriate AccessControlContext for loading classes in > + * the running instance. > + * > + * The default context during class-loading only allows connection to > + * codebase. However applets are allowed to load jars from arbitrary > + * locations and the codebase only access falls short if a class from > + * one location needs a class from another. > + * > + * Given protected access since CodeBaseClassloader uses this function too. > + * > + * @return The appropriate AccessControlContext for loading classes for this instance > + */ > + public AccessControlContext getAccessControlContextForClassLoading() { > + AccessControlContext context = AccessController.getContext(); > + > + try { > + context.checkPermission(new AllPermission()); > + return context; // If context already has all permissions, don't bother > + } catch (AccessControlException ace) { > + // continue below > + } > + > + // Since this is for class-loading, technically any class from one jar > + // should be able to access a class from another, therefore making the > + // original context code source irrelevant > + PermissionCollection permissions = this.security.getSandBoxPermissions(); > + > + // Local cache access permissions > + for (Permission resourcePermission : resourcePermissions) { > + permissions.add(resourcePermission); > + } > + > + // Permissions for all remote hosting urls > + for (URL u: jarLocationSecurityMap.keySet()) { > + permissions.add(new SocketPermission(u.getHost(), > + "connect, accept")); > + } > + > + // Permissions for codebase urls > + for (URL u : codeBaseLoader.getURLs()) { > + permissions.add(new SocketPermission(u.getHost(), > + "connect, accept")); > + } > + > + ProtectionDomain pd = new ProtectionDomain(null, permissions); > + > + return new AccessControlContext(new ProtectionDomain[] { pd }); > + } > + > /* > * Helper class to expose protected URLClassLoader methods. > */ > @@ -1927,10 +2028,16 @@ > throw new ClassNotFoundException(name); > > try { > - return super.findClass(name); > - } catch (ClassNotFoundException cnfe) { > + final String fName = name; > + return AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() throws ClassNotFoundException { > + return CodeBaseClassLoader.super.findClass(fName); > + } > + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > notFoundResources.put(name, super.getURLs()); > - throw cnfe; > + throw new ClassNotFoundException("Could not find class " + name); > } > } > > @@ -1983,8 +2090,18 @@ > if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) > return null; > > + URL url = null; > if (!name.startsWith("META-INF")) { > - URL url = super.findResource(name); > + try { > + final String fName = name; > + url = AccessController.doPrivileged( > + new PrivilegedExceptionAction() { > + public URL run() { > + return CodeBaseClassLoader.super.findResource(fName); > + } > + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + } > > if (url == null) { > notFoundResources.put(name, super.getURLs()); Thanx for patch! J. From ChrisPhi at redhat.com Mon Jun 4 05:15:42 2012 From: ChrisPhi at redhat.com (Chris Phillips) Date: Mon, 04 Jun 2012 08:15:42 -0400 Subject: RFC: Patch to enable adapter_opt_spread jsr 292 adapter code in zero Message-ID: <4FCCA6EE.2030509@RedHat.Com> Hi This patch provides support for jsr 292 in zero. It is against : http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot but will eventually apply to upstream also, ( after fixing other issues to allow testing). It enables a portion of jsr 292 logic that was not functional in the c++ Interpreter. It passes a large portion of the internal dynamic invoke test suite (test/java/lang/invoke) although there are still 4 failing tests and 10 "NYI" (mostly involving Ricochet frames). It has been vetted once in a slightly altered form internally but I would appreciate a few more eyes, would like to apply so qa testing can continue later today. Chris -------------- next part -------------- # HG changeset patch # User chrisphi # Date 1338811077 14400 # Node ID 561eb697c5db0b4eb9953b4c120db90dc4a387a0 # Parent d1154290751107fc148173d73bc0cdef145f2230 Enable _adapter_opt_spread* jsr 292 code, now passes all but 14 tests in John Rose test suite, 10 of those are NYI. Should fix issues seen in arm qa testing. diff --git a/src/cpu/zero/vm/cppInterpreter_zero.cpp b/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -36,6 +36,7 @@ #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" #include "runtime/arguments.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" @@ -65,6 +66,14 @@ CALL_VM_NOCHECK_NOFIX(func) \ fixup_after_potential_safepoint() + +#ifdef DEBUG +#define CPPINT_DEBUG( Z_code_ ) Z_code_ +CPPINT_DEBUG ( static const char *FFng_Zero_Flag = "CPPINT_DEBUG_ON\n"; ) +#else +#define CPPINT_DEBUG( Z_code_ ) +#endif + int CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; @@ -699,6 +708,9 @@ method_handle = adapter; } + CPPINT_DEBUG( tty->print_cr( "Process method_handle sp: 0x%x unwind_sp: 0x%x result_slots: %d.", \ + stack->sp(), unwind_sp, result_slots ); ) + // Start processing process_method_handle(method_handle, THREAD); if (HAS_PENDING_EXCEPTION) @@ -718,6 +730,8 @@ } // Check + CPPINT_DEBUG( tty->print_cr( "Exiting method_handle_entry, sp: 0x%x unwind_sp: 0x%x result_slots: %d.", \ + stack->sp(), unwind_sp, result_slots ); ) assert(stack->sp() == unwind_sp - result_slots, "should be"); // No deoptimized frames on the stack @@ -725,6 +739,7 @@ } void CppInterpreter::process_method_handle(oop method_handle, TRAPS) { + JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); intptr_t *vmslots = stack->sp(); @@ -739,6 +754,7 @@ (MethodHandles::EntryKind) (((intptr_t) entry) & 0xffffffff); methodOop method = NULL; + CPPINT_DEBUG( tty->print_cr( "\nEntering %s 0x%x.",MethodHandles::entry_name(entry_kind), (char *)vmslots ); ) switch (entry_kind) { case MethodHandles::_invokestatic_mh: direct_to_method = true; @@ -1080,12 +1096,308 @@ } break; - default: - tty->print_cr("unhandled entry_kind %s", + case MethodHandles::_adapter_opt_spread_0: + case MethodHandles::_adapter_opt_spread_1_ref: + case MethodHandles::_adapter_opt_spread_2_ref: + case MethodHandles::_adapter_opt_spread_3_ref: + case MethodHandles::_adapter_opt_spread_4_ref: + case MethodHandles::_adapter_opt_spread_5_ref: + case MethodHandles::_adapter_opt_spread_ref: + case MethodHandles::_adapter_opt_spread_byte: + case MethodHandles::_adapter_opt_spread_char: + case MethodHandles::_adapter_opt_spread_short: + case MethodHandles::_adapter_opt_spread_int: + case MethodHandles::_adapter_opt_spread_long: + case MethodHandles::_adapter_opt_spread_float: + case MethodHandles::_adapter_opt_spread_double: + { + + // spread an array out into a group of arguments + + int arg_slot = + java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); + // Fetch the argument, which we will cast to the required array type. + oop arg = VMSLOTS_OBJECT(arg_slot); + + BasicType elem_type = + MethodHandles::ek_adapter_opt_spread_type(entry_kind); + int elem_slots = + type2size[elem_type]; // 1 or 2 + int array_slots = + 1; // array is always a T_OBJECT + int length_offset = + arrayOopDesc::length_offset_in_bytes(); + int elem0_offset = + arrayOopDesc::base_offset_in_bytes(elem_type); + int length_constant = + MethodHandles::ek_adapter_opt_spread_count(entry_kind); + int array_length = 0; + void *array_elem0 = NULL; + + CPPINT_DEBUG( tty->print_cr( \ + "ENTERING _adapter_opt_spread: %s %d %d 0x%x 0x%x", \ + type2name(elem_type), arg_slot, length_constant, (char *)arg, stack->sp() ); ) + + // If the spread count is -1, the length is "variable" ie controlled + // by the array length. + // See ek_adapter_opt_spread_count in methodHandles.hpp + // If array lenth is 0 or spread count is 0 , we will remove the argslot. + + bool length_can_be_zero = (length_constant == 0); + if (length_constant < 0) { + // some adapters with variable length must handle the zero case + if (!OptimizeMethodHandles || + elem_type != T_OBJECT) + length_can_be_zero = true; + } + + if (arg == NULL) { + CPPINT_DEBUG( tty->print_cr( \ + "arg NULL implies Array_length == 0, remove slot." ); ) + // remove arg slot + remove_vmslots(arg_slot, 1, THREAD); // doesn't trap + vmslots = stack->sp(); // unused, but let the compiler figure that out + CPPINT_DEBUG( tty->print_cr( \ + " >> Would LEAVE _adapter_opt_spread with NPE." ); ) +#ifdef _NOT_DEF_ + // queue a nullpointer exception for the caller + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_NullPointerException())); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; +#endif + } else { // (arg != NULL) + klassOop objKlassOop = arg->klass(); + klassOop klassOf = java_lang_Class::as_klassOop( + java_lang_invoke_AdapterMethodHandle::argument(method_handle)); + + if (objKlassOop != klassOf && + !objKlassOop->klass_part()->is_subtype_of(klassOf)) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #1 in _adapter_opt_spread." ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + // Check the array type. + + klassOop array_klass_oop = NULL; + BasicType array_type = java_lang_Class::as_BasicType( + java_lang_invoke_AdapterMethodHandle::argument(method_handle), + &array_klass_oop); + arrayKlassHandle array_klass(THREAD, array_klass_oop); + + assert(array_type == T_OBJECT, ""); + assert(Klass::cast(array_klass_oop)->oop_is_array(), ""); + if (!(array_type == T_OBJECT) || + !(Klass::cast(array_klass_oop)->oop_is_array())) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #2 not an array in _adapter_opt_spread." ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + klassOop element_klass_oop = NULL; + BasicType element_type = + java_lang_Class::as_BasicType(array_klass->component_mirror(), + &element_klass_oop); + KlassHandle element_klass(THREAD, element_klass_oop); + if (elem_type != element_type) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #3 invalid type in _adapter_opt_spread." ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + array_length = arrayOop(arg)->length(); + + // Check the required length. + if (length_constant > 0) { // must match ? + if ( array_length != length_constant ) { + CPPINT_DEBUG( tty->print_cr( \ + "ARRY INDEX ERROR #4 invalid array length in _adapter_opt_spread." ); ) + //fixme ArrayIndexOutOfBoundsException ? + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + // use array_length ? + } else { // length_constant == [ -1 or 0 ] + if ( (array_length > 0) || length_can_be_zero ) { + // use array_length. + } else { // array_length 0 and not length_can_be_zero + CPPINT_DEBUG( tty->print_cr( \ + "ARRY INDEX ERROR #5 arry length 0 in _adapter_opt_spread." ); ) + //fixme ArrayIndexOutOfBoundsException ? + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + } + + // Array length checked out. Now insert any required arg slots. + // array_length - 1 more slots if array_length > 0 + // otherwise if array_length == 0 remove arg_slot. + + if ( array_length > 0 ) { + int slots = (array_length * elem_slots) - 1; + CPPINT_DEBUG( tty->print_cr( \ + "array_length %d %d slots needed in _adapter_opt_spread.",\ + array_length, slots); ) + debug_only(if (elem_slots == 2) \ + assert ((slots % 2 == 1)," bad slots calc")); + if ( slots > 0 ) { + intptr_t *unwind_sp = + calculate_unwind_sp(stack, method_handle); + insert_vmslots(arg_slot, slots, THREAD); + if (HAS_PENDING_EXCEPTION) { + // all oops trashed + stack->set_sp(unwind_sp); + return; + } + } + vmslots = stack->sp(); + arg_slot += slots; + + array_elem0 = arrayOop(arg)->base(elem_type); + + // Copy from the array to the new arg slots. + // [from native : Beware: Arguments that are shallow + // on the stack are deep in the array, + // and vice versa. So a downward-growing stack (the usual) + // has to be copied elementwise in reverse order + // from the source array.] + + void * array_elem = array_elem0; + int top_slot = arg_slot; + + debug_only(if (elem_slots == 2) \ + assert ((((u_int)(char *)&vmslots[top_slot]) % \ + (u_int)type2aelembytes(elem_type) == 0), \ + " bad arg alignment")); + + CPPINT_DEBUG( tty->print_cr( \ + "BEGIN ARRY LOOP %d %d 0x%x 0x%x _adapter_opt_spread.",\ + array_length, top_slot, &vmslots[top_slot], array_elem ); ) + + for (int index = 0; index < array_length; index++) { + switch (elem_type) { + case T_BYTE: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_CHAR: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_SHORT: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_INT: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_FLOAT: + SET_VMSLOTS_FLOAT(*(jfloat*)array_elem,top_slot); + break; + case T_LONG: + SET_VMSLOTS_LONG(*(jlong*)array_elem, top_slot); + break; + case T_DOUBLE: + SET_VMSLOTS_DOUBLE(*(jdouble*)array_elem, top_slot); + break; + case T_OBJECT: + SET_VMSLOTS_OBJECT(*(oopDesc**)array_elem, top_slot); + break; + default: + tty->print_cr("unhandled type %s", type2name(elem_type)); + ShouldNotReachHere(); + } + array_elem = (void*)((char *)array_elem + + type2aelembytes(elem_type)); + top_slot -= elem_slots; + } + arg_slot++; + } + } + if ((array_length == 0) && (arg != NULL)) { + CPPINT_DEBUG( tty->print_cr( \ + "Array_length == 0, will remove slot." ); ) + // remove arg slot + remove_vmslots(arg_slot, 1, THREAD); // doesn't trap + // unused, but let the compiler figure that out + vmslots = stack->sp(); + // + } + CPPINT_DEBUG( tty->print_cr( \ + "LEAVING _adapter_opt_spread: %s 0x%x 0x%x \n", \ + type2name(elem_type), (char *)arg, (char *)stack->sp() ); ) + } + break; + default: + tty->print_cr("unhandled entry_kind %s", MethodHandles::entry_name(entry_kind)); - ShouldNotReachHere(); + ShouldNotReachHere(); } + // Continue along the chain if (direct_to_method) { if (method == NULL) { @@ -1138,6 +1450,7 @@ tty->print_cr("dst_rtype = %s", type2name(dst_rtype)); ShouldNotReachHere(); } + CPPINT_DEBUG( tty->print_cr( "LEAVING %s\n",MethodHandles::entry_name(entry_kind) ); ) } // The new slots will be inserted before slot insert_before. diff --git a/src/cpu/zero/vm/methodHandles_zero.cpp b/src/cpu/zero/vm/methodHandles_zero.cpp --- a/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/src/cpu/zero/vm/methodHandles_zero.cpp @@ -38,9 +38,8 @@ |(1< Hi! This set of patches is finsihing removing of std out/err from all tests to some more usable logging. Last time I have replaced most of std out/err by logging bottleneck which was just reprinting the information with id of its calling method (Few forgotten are replaced in this patch). Today I'm adding alternative output (and silencing std out/err). Each "logged" or "printed out/err" message in tests (especially stdouts/errs of launched javaws/browsers) are now recorded in stderr.log, stdout.log and all.log (as was before by stream redirection in makefile). Except this the events are saved to xml file where are sorted by class, test(method) and origin (time and err/out identification). This xml file is flushed (by system hook) after testsuite ends (and if log is not empty). Although this xml file is more easily navigable then original plaintext, what I wanted was to be able to click in result file and jump immediately into log of the test. To this purpose serves html file (generated by xslt from xml with few javascript functions and few styles). If anybody will find this to complex, please check current "logs". With growing number of tests they have become very unreadable - and so useless. The friendly addition of thischangeset is that tests passed/failed are printed to make run imidiately after theirs processing, and the text result is to be seen at the end of the make target again. logging-all - overall-patch with all related changes. logging-integration - using new generated logs instead of plain stream redirection * Makefile.am: (stamps/run-netx-unit-tests.stamp) and (stamps/run-netx-dist-tests.stamp) removed redirection of streams as logging is now done in serveraccess tests extensions added xsltproc execution above generated xml log xsltproc generating results html files is now receiving result of above as parameter * tests/report-styles/jreport.xsl: log parameter is now accepted, and if set, then all tests are linking into specified file to show the log * tests/report-styles/report.css: added styles for new links logging-newSheets - is introducing visualisation of log and navigation between log and existing results fiels * tests/report-styles/index.js: new functions to work for result of below sheet * tests/report-styles/logs.xsl: new file, sheet to convert xml log to hrml file * tests/report-styles/output.css: new file, styles of above html file logging-remainingRemovingOfStdOutErr - is removing remianign Systemm.out/err and printStackTraces * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: Tests', server's and ProcessAssasin's logs are now redirected to bottleneck logging-xmlGenerationAndMovingOfLoging - is providing sorted logging and xml file generation * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: (LOGS_REPRINT) flag for debugging purposes, will enable reprinting to stdout/err again (DEFAULT_LOG_FILE ) default name of xml output (DEFAULT_STDERR_FILE)(DEFAULT_STDOUT_FILE)(DEFAULT_STDLOGS_FILE) default values of plain text output files (*ELEMENT) and( (*ATTRIBUTE) variables keeping repeated names of xml output parts (writeXmlLog) method called from Sytsem.hook to save xml log (addToXmlLog) method to record item to xml structure (TestsLogs) and (LogItem) inner classes to keep logging information (log) is now reprinting message with id to std out/err dependently on (LOGS_REPRINT) but always to internal streams, possilbe exception is thrown (logException) new method, shortcut to log exception in same way as message (getTestMethod) now can handle methods inside ServerAccess class too Atatched is small example of output files. I hope you will find this useful. Best regards, J. -------------- next part -------------- A non-text attachment was scrubbed... Name: logging-all.diff Type: text/x-patch Size: 35981 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/logging-all.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: logging-integration.diff Type: text/x-patch Size: 4421 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/logging-integration.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: logging-newSheets.diff Type: text/x-patch Size: 10714 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/logging-newSheets.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: logging-remainingRemovingOfStdOutErr.diff Type: text/x-patch Size: 9976 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/logging-remainingRemovingOfStdOutErr.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: logging-xmlGenerationAndMovingOfLoging.diff Type: text/x-patch Size: 11166 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/logging-xmlGenerationAndMovingOfLoging.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-web-shortLog.tar.gz Type: application/x-gzip Size: 38034 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/d6ba5856/icedtea-web-shortLog.tar.gz From adomurad at redhat.com Mon Jun 4 08:32:35 2012 From: adomurad at redhat.com (Adam Domurad) Date: Mon, 04 Jun 2012 11:32:35 -0400 Subject: [rfc][icedtea-web] Fix for PR518, NPString.utf8characters not guaranteed to be null-terminated Message-ID: <1338823955.24497.52.camel@voip-10-15-18-79.yyz.redhat.com> Hey all. This is a fix for PR518 that adds a utility function for wrapping NPString's in a null terminated std::string. It is used wherever utf8characters was accessed previously. This also has the benefit of consolidating some #ifdef blocks to one location. I took the route of using std::string over gchar* as suggested in the bug report to be conveniently sure memory is freed. (Note, passing along std::string's by value is quite efficient because GCC uses reference counting techniques for sharing of character arrays used in std::string) ChangeLog: 2012-06-04 Adam Domurad This patch fixes PR518, ensures null termination of strings based off of NPVariant results. * plugin/icedteanp/IcedTeaPluginUtils.h: Added declaration of NPVariantAsString * plugin/icedteanp/IcedTeaPluginUtils.cc (NPVariantAsString): New. Converts an NPVariant to a std::string, assumes it is a string. (isObjectJSArray): Now uses NPVariantAsString, minor cleanup. * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (plugin_get_documentbase): Now uses NPVariantAsString. * plugin/icedteanp/IcedTeaNPPlugin.cc (NPVariantToString): Now uses NPVariantAsString, minor cleanup. -------------- next part -------------- A non-text attachment was scrubbed... Name: fixPR518.patch Type: text/x-patch Size: 7550 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/70140498/fixPR518.patch From ddadacha at redhat.com Mon Jun 4 08:42:32 2012 From: ddadacha at redhat.com (Danesh Dadachanji) Date: Mon, 04 Jun 2012 11:42:32 -0400 Subject: [RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value. In-Reply-To: <4FCC8EF7.2030505@redhat.com> References: <4F5E69D6.9060401@redhat.com> <4F913542.5050500@redhat.com> <4FC66E9C.2080500@redhat.com> <4FC692E7.7000103@redhat.com> <4FCC8EF7.2030505@redhat.com> Message-ID: <4FCCD768.5010402@redhat.com> On 04/06/12 06:33 AM, Jiri Vanek wrote: > On 05/30/2012 11:36 PM, Omair Majid wrote: >> On 05/30/2012 03:01 PM, Danesh Dadachanji wrote: >>> >>> Attached a new patch with the refactored code and a unit test. >> >> I have a few comments on the patch below. >> >>> I added a static method that just wraps around the new URL assignment. I >>> couldn't figure out how to test PluginBridge directly without having it >>> open an actual JNLP file. :/ I made it static to make the unit test >>> cleaner (did not have to deal with creating a new PluginBridge var etc) >>> since it is quite the simple method and really only serves for unit >>> testing purposes. If others prefer, I can make it non-static. >> >> I think it's fine as long as it's implied clearly that this static >> method is meant to be private (it can't be made private since it's used >> in the test class). >> >>> diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java >>> --- a/netx/net/sourceforge/jnlp/PluginBridge.java >>> +++ b/netx/net/sourceforge/jnlp/PluginBridge.java >>> @@ -171,6 +171,18 @@ public class PluginBridge extends JNLPFi >>> codeBaseLookup = cbl == null || (Boolean.valueOf(cbl)); >>> } >>> >>> + /** >>> + * Evaluate if the location is a relative or absolute path. Use the codeBase >>> + * as the URL context if it is relative. >>> + * @param codeBase The URL used for context if needed. >>> + * @param location The address pointing to the JNLP. >>> + * @return A URL to the location of the JNLP file. >>> + * @throws MalformedURLException >>> + */ >> >> I would prefer a comment saying this method should be considered private >> rather than cleanly documenting it. >> >>> + static URL getEvaluatedJNLPHref(URL codeBase, String location) throws MalformedURLException { >>> + return new URL(codeBase, location); >>> + } >>> + >>> public boolean codeBaseLookup() { >>> return codeBaseLookup; >>> } >>> diff --git a/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java >>> new file mode 100644 >>> --- /dev/null >>> +++ b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java >>> @@ -0,0 +1,27 @@ >>> +package net.sourceforge.jnlp; >> >> You are missing the license here. >> Thanks, fixed! >>> + @Test >>> + public void testAbsoluteJNLPHref() throws MalformedURLException, Exception { >>> + URL codeBase = new URL("http://undesired.absolute.codebase.com"); >>> + String absoluteLocation = "http://absolute.href.com/test.jnlp"; >>> + assertEquals(absoluteLocation, >>> + PluginBridge.getEvaluatedJNLPHref(codeBase, absoluteLocation).toExternalForm()); >>> + } >>> + >>> + @Test >>> + public void testARelativeJNLPHref() throws MalformedURLException, Exception { >>> + URL codeBase = new URL("http://desired.absolute.codebase.com"); >>> + String relativeLocation = "sub/dir/test.jnlp"; >>> + assertEquals(codeBase + "/" + relativeLocation, >>> + PluginBridge.getEvaluatedJNLPHref(codeBase, relativeLocation).toExternalForm()); >>> + } >>> +} >> >> If you want to be extra pedantic, one more test: >> >> URL codeBase = new URL("http://desired.absolute.codebase.com/foo"); >> String relativeLocation = "/sub/dir/test.jnlp"; >> >> Result should be "http://desired.absolute.codebase.com/sub/dir/test.jnlp" >> Added, works as expected. >> But I am feeling sort of uncomfortable about this. These tests are just >> testing that 'new URL(a,b)' works sanely in java. If it doesn't, then >> the JVM is broken and there is nothing we can do about it. It doesn't >> help us in any way if these tests pass because these tests aren't >> verifying that PluginBridge uses this correct url. > > Although I'm sharing Omair's concerns, I think the tests for method for purpose of its future modifications and as behaviour > demonstrations are enough. > Too late =) I wasn't too happy with this change either so I hunted down a better solution. I noticed some of the tests used JNLPs directly so I attempted to integrate that into my test and use the first patch (without the evaluation wrapper). However, Omair pointed out that using JNLPs is not ideal because this adds test coverage of the parser. So to avoid this, I've added the strategy class JNLPCreator that wraps around the creation of a JNLPFile. Under netx, it will simply do what it did before, create a normal JNLPFile. In the test however, it creates a mock JNLP, one that only has the bits my test in particular cares about (e.g. location). The additional class in the unit test is there to ensure PluginBridge's constructor can run without throwing exceptions. +2012-06-04 Danesh Dadachanji + + Fix to handle absolute paths passed into jnlp_href's value. + * netx/net/sourceforge/jnlp/PluginBridge.java + (PluginBridge): Uses context of codebase to evaluate jnlp_href's value. + Uses JNLPCreator's create method to make new JNLPFile variables. + New constructor that wraps around the original one, creating a new + JNLPCreator to use. + * netx/net/sourceforge/jnlp/JNLPCreator.java: New strategy pattern class + to be used to wrap around the creation of a JNLPFile. Replace this creator + when unit testing to skip running parsing code. + * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: + New class to unit test getEvaluatedJNLPHref. + Thanks to both of you for commenting! Any more would be appreciated. Cheers, Danesh -------------- next part -------------- A non-text attachment was scrubbed... Name: absolute-url-jnlp_href-03.patch Type: text/x-patch Size: 9072 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/f7ab1acf/absolute-url-jnlp_href-03.patch From dbhole at redhat.com Mon Jun 4 08:53:00 2012 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 4 Jun 2012 11:53:00 -0400 Subject: [rfc][icedtea-web] Fix for PR518, NPString.utf8characters not guaranteed to be null-terminated In-Reply-To: <1338823955.24497.52.camel@voip-10-15-18-79.yyz.redhat.com> References: <1338823955.24497.52.camel@voip-10-15-18-79.yyz.redhat.com> Message-ID: <20120604155259.GB4865@redhat.com> * Adam Domurad [2012-06-04 11:42]: > Hey all. This is a fix for PR518 that adds a utility function for > wrapping NPString's in a null terminated std::string. It is used > wherever utf8characters was accessed previously. This also has the > benefit of consolidating some #ifdef blocks to one location. > > I took the route of using std::string over gchar* as suggested in the > bug report to be conveniently sure memory is freed. > > (Note, passing along std::string's by value is quite efficient because > GCC uses reference counting techniques for sharing of character arrays > used in std::string) > Looks fine to me. OK for HEAD. Cheers, Deepak > ChangeLog: > 2012-06-04 Adam Domurad > > This patch fixes PR518, ensures null termination of strings based off > of NPVariant results. > * plugin/icedteanp/IcedTeaPluginUtils.h: Added declaration of > NPVariantAsString > * plugin/icedteanp/IcedTeaPluginUtils.cc > (NPVariantAsString): New. Converts an NPVariant to a > std::string, assumes it is a string. > (isObjectJSArray): Now uses NPVariantAsString, minor cleanup. > * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc > (plugin_get_documentbase): Now uses NPVariantAsString. > * plugin/icedteanp/IcedTeaNPPlugin.cc > (NPVariantToString): Now uses NPVariantAsString, minor cleanup. > > diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc > --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc > +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc > @@ -904,11 +904,7 @@ createJavaObjectFromVariant(NPP instance > } else if (NPVARIANT_IS_STRING(variant)) > { > className = "java.lang.String"; > -#if MOZILLA_VERSION_COLLAPSED < 1090200 > - stringArg.append(NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); > -#else > - stringArg.append(NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); > -#endif > + stringArg = IcedTeaPluginUtilities::NPVariantAsString(variant); > } else if (NPVARIANT_IS_OBJECT(variant)) > { > > diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc > --- a/plugin/icedteanp/IcedTeaNPPlugin.cc > +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc > @@ -1093,17 +1093,10 @@ plugin_get_documentbase (NPP instance) > browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(location), > href_id, &href); > > + std::string href_str = IcedTeaPluginUtilities::NPVariantAsString(href); > + > // Strip everything after the last "/" > - char *href_str; > -#if MOZILLA_VERSION_COLLAPSED < 1090200 > - href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).utf8length + 1); > - snprintf(href_str, NPVARIANT_TO_STRING(href).utf8length+1, "%s", NPVARIANT_TO_STRING(href).utf8characters); > -#else > - href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).UTF8Length + 1); > - snprintf(href_str, NPVARIANT_TO_STRING(href).UTF8Length+1, "%s", NPVARIANT_TO_STRING(href).UTF8Characters); > -#endif > - > - gchar** parts = g_strsplit (href_str, "/", -1); > + gchar** parts = g_strsplit (href_str.c_str(), "/", -1); > guint parts_sz = g_strv_length (parts); > > std::string location_str; > @@ -1119,8 +1112,6 @@ plugin_get_documentbase (NPP instance) > browser_functions.releasevariantvalue(&href); > browser_functions.releasevariantvalue(&location); > g_strfreev(parts); > - free(href_str); > - href_str = NULL; > cleanup_done: > PLUGIN_DEBUG ("plugin_get_documentbase return\n"); > PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy); > diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc > --- a/plugin/icedteanp/IcedTeaPluginUtils.cc > +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc > @@ -661,11 +661,8 @@ IcedTeaPluginUtilities::printNPVariant(N > } > else if (NPVARIANT_IS_STRING(variant)) > { > -#if MOZILLA_VERSION_COLLAPSED < 1090200 > - PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); > -#else > - PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); > -#endif > + std::string str = IcedTeaPluginUtilities::NPVariantAsString(variant); > + PLUGIN_DEBUG("STRING: %s (length=%d)\n", str.c_str(), str.size()); > } > else > { > @@ -676,52 +673,44 @@ IcedTeaPluginUtilities::printNPVariant(N > void > IcedTeaPluginUtilities::NPVariantToString(NPVariant variant, std::string* result) > { > - char str[NUM_STR_BUFFER_SIZE]; // enough for everything except string > - char* largestr = NULL; > - if (NPVARIANT_IS_VOID(variant)) > + char conv_str[NUM_STR_BUFFER_SIZE]; // conversion buffer > + bool was_string_already = false; > + > + if (NPVARIANT_IS_STRING(variant)) > { > - snprintf(str, NUM_STR_BUFFER_SIZE, "%p", variant); > + result->append(IcedTeaPluginUtilities::NPVariantAsString(variant)); > + was_string_already = true; > + } > + else if (NPVARIANT_IS_VOID(variant)) > + { > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%p", variant); > } > else if (NPVARIANT_IS_NULL(variant)) > { > - snprintf(str, NUM_STR_BUFFER_SIZE, "NULL"); > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "NULL"); > } > else if (NPVARIANT_IS_BOOLEAN(variant)) > { > if (NPVARIANT_TO_BOOLEAN(variant)) > - snprintf(str, NUM_STR_BUFFER_SIZE, "true"); > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "true"); > else > - snprintf(str, NUM_STR_BUFFER_SIZE, "false"); > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "false"); > } > else if (NPVARIANT_IS_INT32(variant)) > { > - snprintf(str, NUM_STR_BUFFER_SIZE, "%d", NPVARIANT_TO_INT32(variant)); > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%d", NPVARIANT_TO_INT32(variant)); > } > else if (NPVARIANT_IS_DOUBLE(variant)) > { > - snprintf(str, NUM_STR_BUFFER_SIZE, "%f", NPVARIANT_TO_DOUBLE(variant)); > - } > - else if (NPVARIANT_IS_STRING(variant)) > - { > -#if MOZILLA_VERSION_COLLAPSED < 1090200 > - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).utf8length+1; > - largestr = (char*) malloc(buffersize); > - snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).utf8characters); > -#else > - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).UTF8Length+1; > - largestr = (char*) malloc(buffersize); > - snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).UTF8Characters); > -#endif > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%f", NPVARIANT_TO_DOUBLE(variant)); > } > else > { > - snprintf(str, NUM_STR_BUFFER_SIZE, "[Object %p]", variant); > + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "[Object %p]", variant); > } > - if (largestr != NULL){ > - result->append(largestr); > - free(largestr); > - } else { > - result->append(str); > + > + if (!was_string_already){ > + result->append(conv_str); > } > } > > @@ -861,13 +850,7 @@ IcedTeaPluginUtilities::isObjectJSArray( > browser_functions.invoke(instance, constructor, toString, NULL, 0, &constructor_str); > IcedTeaPluginUtilities::printNPVariant(constructor_str); > > - std::string constructor_name = std::string(); > - > -#if MOZILLA_VERSION_COLLAPSED < 1090200 > - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).utf8characters, NPVARIANT_TO_STRING(constructor_str).utf8length); > -#else > - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters, NPVARIANT_TO_STRING(constructor_str).UTF8Length); > -#endif > + std::string constructor_name = IcedTeaPluginUtilities::NPVariantAsString(constructor_str); > > PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str()); > > @@ -910,6 +893,20 @@ IcedTeaPluginUtilities::decodeURL(const > PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url); > } > > +/* Copies a variant data type into a C++ string */ > +std::string > +IcedTeaPluginUtilities::NPVariantAsString(NPVariant variant) > +{ > +#if MOZILLA_VERSION_COLLAPSED < 1090200 > + return std::string(( > + NPVARIANT_TO_STRING(variant).utf8characters, > + NPVARIANT_TO_STRING(variant).utf8ength); > +#else > + return std::string( > + NPVARIANT_TO_STRING(variant).UTF8Characters, > + NPVARIANT_TO_STRING(variant).UTF8Length); > +#endif > +} > > /** > * Posts a function for execution on the plug-in thread and wait for result. > diff --git a/plugin/icedteanp/IcedTeaPluginUtils.h b/plugin/icedteanp/IcedTeaPluginUtils.h > --- a/plugin/icedteanp/IcedTeaPluginUtils.h > +++ b/plugin/icedteanp/IcedTeaPluginUtils.h > @@ -209,6 +209,9 @@ class IcedTeaPluginUtilities > /* Converts the given integer to a string */ > static void itoa(int i, std::string* result); > > + /* Copies a variant data type into a C++ string */ > + static std::string NPVariantAsString(NPVariant variant); > + > /* Frees the given vector and the strings that its contents point to */ > static void freeStringPtrVector(std::vector* v); > From omajid at redhat.com Mon Jun 4 08:53:20 2012 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Jun 2012 11:53:20 -0400 Subject: [RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value. In-Reply-To: <4FCCD768.5010402@redhat.com> References: <4F5E69D6.9060401@redhat.com> <4F913542.5050500@redhat.com> <4FC66E9C.2080500@redhat.com> <4FC692E7.7000103@redhat.com> <4FCC8EF7.2030505@redhat.com> <4FCCD768.5010402@redhat.com> Message-ID: <4FCCD9F0.5090706@redhat.com> On 06/04/2012 11:42 AM, Danesh Dadachanji wrote: > Too late =) I wasn't too happy with this change either so I hunted down > a better solution. I noticed some of the tests used JNLPs directly so I > attempted to integrate that into my test and use the first patch > (without the evaluation wrapper). However, Omair pointed out that using > JNLPs is not ideal because this adds test coverage of the parser. So to > avoid this, I've added the strategy class JNLPCreator that wraps around > the creation of a JNLPFile. Under netx, it will simply do what it did > before, create a normal JNLPFile. In the test however, it creates a mock > JNLP, one that only has the bits my test in particular cares about (e.g. > location). The additional class in the unit test is there to ensure > PluginBridge's constructor can run without throwing exceptions. Looks good to me. Cheers, Omair From adomurad at icedtea.classpath.org Mon Jun 4 09:07:39 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Mon, 04 Jun 2012 16:07:39 +0000 Subject: /hg/icedtea-web: Fix for PR518, adds utility function for wrappi... Message-ID: changeset ff8d91a6a006 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=ff8d91a6a006 author: Adam Domurad date: Mon Jun 04 12:07:33 2012 -0400 Fix for PR518, adds utility function for wrapping NPString in std::string. diffstat: AUTHORS | 1 + ChangeLog | 16 +++++ plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 6 +- plugin/icedteanp/IcedTeaNPPlugin.cc | 15 +---- plugin/icedteanp/IcedTeaPluginUtils.cc | 75 ++++++++++++------------- plugin/icedteanp/IcedTeaPluginUtils.h | 3 + 6 files changed, 60 insertions(+), 56 deletions(-) diffs (221 lines): diff -r 73f6e7fd1446 -r ff8d91a6a006 AUTHORS --- a/AUTHORS Fri Jun 01 16:44:32 2012 -0400 +++ b/AUTHORS Mon Jun 04 12:07:33 2012 -0400 @@ -5,6 +5,7 @@ Deepak Bhole Ricardo Mart??n Camarero Danesh Dadachanji +Adam Domurad Thomas Fitzsimmons Mark Greenwood Andrew John Hughes diff -r 73f6e7fd1446 -r ff8d91a6a006 ChangeLog --- a/ChangeLog Fri Jun 01 16:44:32 2012 -0400 +++ b/ChangeLog Mon Jun 04 12:07:33 2012 -0400 @@ -1,3 +1,19 @@ +2012-06-04 Adam Domurad + + Added self to AUTHORS. + This patch fixes PR518, ensures null termination of strings based off + of NPVariant results. + * plugin/icedteanp/IcedTeaPluginUtils.h: Added declaration of + NPVariantAsString + * plugin/icedteanp/IcedTeaPluginUtils.cc + (NPVariantAsString): New. Converts an NPVariant to a + std::string, assumes it is a valid NPString. + (isObjectJSArray): Now uses NPVariantAsString, minor cleanup. + * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc + (plugin_get_documentbase): Now uses NPVariantAsString. + * plugin/icedteanp/IcedTeaNPPlugin.cc + (NPVariantToString): Now uses NPVariantAsString, minor cleanup. + 2012-06-01 Deepak Bhole PR863: Error passing strings to applet methods in Chromium diff -r 73f6e7fd1446 -r ff8d91a6a006 plugin/icedteanp/IcedTeaJavaRequestProcessor.cc --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Fri Jun 01 16:44:32 2012 -0400 +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc Mon Jun 04 12:07:33 2012 -0400 @@ -904,11 +904,7 @@ } else if (NPVARIANT_IS_STRING(variant)) { className = "java.lang.String"; -#if MOZILLA_VERSION_COLLAPSED < 1090200 - stringArg.append(NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); -#else - stringArg.append(NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); -#endif + stringArg = IcedTeaPluginUtilities::NPVariantAsString(variant); } else if (NPVARIANT_IS_OBJECT(variant)) { diff -r 73f6e7fd1446 -r ff8d91a6a006 plugin/icedteanp/IcedTeaNPPlugin.cc --- a/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Jun 01 16:44:32 2012 -0400 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Mon Jun 04 12:07:33 2012 -0400 @@ -1093,17 +1093,10 @@ browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(location), href_id, &href); + std::string href_str = IcedTeaPluginUtilities::NPVariantAsString(href); + // Strip everything after the last "/" - char *href_str; -#if MOZILLA_VERSION_COLLAPSED < 1090200 - href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).utf8length + 1); - snprintf(href_str, NPVARIANT_TO_STRING(href).utf8length+1, "%s", NPVARIANT_TO_STRING(href).utf8characters); -#else - href_str = (char*) malloc(sizeof(char)*NPVARIANT_TO_STRING(href).UTF8Length + 1); - snprintf(href_str, NPVARIANT_TO_STRING(href).UTF8Length+1, "%s", NPVARIANT_TO_STRING(href).UTF8Characters); -#endif - - gchar** parts = g_strsplit (href_str, "/", -1); + gchar** parts = g_strsplit (href_str.c_str(), "/", -1); guint parts_sz = g_strv_length (parts); std::string location_str; @@ -1119,8 +1112,6 @@ browser_functions.releasevariantvalue(&href); browser_functions.releasevariantvalue(&location); g_strfreev(parts); - free(href_str); - href_str = NULL; cleanup_done: PLUGIN_DEBUG ("plugin_get_documentbase return\n"); PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", documentbase_copy); diff -r 73f6e7fd1446 -r ff8d91a6a006 plugin/icedteanp/IcedTeaPluginUtils.cc --- a/plugin/icedteanp/IcedTeaPluginUtils.cc Fri Jun 01 16:44:32 2012 -0400 +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Mon Jun 04 12:07:33 2012 -0400 @@ -661,11 +661,8 @@ } else if (NPVARIANT_IS_STRING(variant)) { -#if MOZILLA_VERSION_COLLAPSED < 1090200 - PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).utf8characters, NPVARIANT_TO_STRING(variant).utf8length); -#else - PLUGIN_DEBUG("STRING: %s (length=%d)\n", NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); -#endif + std::string str = IcedTeaPluginUtilities::NPVariantAsString(variant); + PLUGIN_DEBUG("STRING: %s (length=%d)\n", str.c_str(), str.size()); } else { @@ -676,52 +673,44 @@ void IcedTeaPluginUtilities::NPVariantToString(NPVariant variant, std::string* result) { - char str[NUM_STR_BUFFER_SIZE]; // enough for everything except string - char* largestr = NULL; - if (NPVARIANT_IS_VOID(variant)) + char conv_str[NUM_STR_BUFFER_SIZE]; // conversion buffer + bool was_string_already = false; + + if (NPVARIANT_IS_STRING(variant)) { - snprintf(str, NUM_STR_BUFFER_SIZE, "%p", variant); + result->append(IcedTeaPluginUtilities::NPVariantAsString(variant)); + was_string_already = true; + } + else if (NPVARIANT_IS_VOID(variant)) + { + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%p", variant); } else if (NPVARIANT_IS_NULL(variant)) { - snprintf(str, NUM_STR_BUFFER_SIZE, "NULL"); + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "NULL"); } else if (NPVARIANT_IS_BOOLEAN(variant)) { if (NPVARIANT_TO_BOOLEAN(variant)) - snprintf(str, NUM_STR_BUFFER_SIZE, "true"); + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "true"); else - snprintf(str, NUM_STR_BUFFER_SIZE, "false"); + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "false"); } else if (NPVARIANT_IS_INT32(variant)) { - snprintf(str, NUM_STR_BUFFER_SIZE, "%d", NPVARIANT_TO_INT32(variant)); + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%d", NPVARIANT_TO_INT32(variant)); } else if (NPVARIANT_IS_DOUBLE(variant)) { - snprintf(str, NUM_STR_BUFFER_SIZE, "%f", NPVARIANT_TO_DOUBLE(variant)); - } - else if (NPVARIANT_IS_STRING(variant)) - { -#if MOZILLA_VERSION_COLLAPSED < 1090200 - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).utf8length+1; - largestr = (char*) malloc(buffersize); - snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).utf8characters); -#else - size_t buffersize = sizeof(char)*NPVARIANT_TO_STRING(variant).UTF8Length+1; - largestr = (char*) malloc(buffersize); - snprintf(str, buffersize, "%s", NPVARIANT_TO_STRING(variant).UTF8Characters); -#endif + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%f", NPVARIANT_TO_DOUBLE(variant)); } else { - snprintf(str, NUM_STR_BUFFER_SIZE, "[Object %p]", variant); + snprintf(conv_str, NUM_STR_BUFFER_SIZE, "[Object %p]", variant); } - if (largestr != NULL){ - result->append(largestr); - free(largestr); - } else { - result->append(str); + + if (!was_string_already){ + result->append(conv_str); } } @@ -861,13 +850,7 @@ browser_functions.invoke(instance, constructor, toString, NULL, 0, &constructor_str); IcedTeaPluginUtilities::printNPVariant(constructor_str); - std::string constructor_name = std::string(); - -#if MOZILLA_VERSION_COLLAPSED < 1090200 - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).utf8characters, NPVARIANT_TO_STRING(constructor_str).utf8length); -#else - constructor_name.append(NPVARIANT_TO_STRING(constructor_str).UTF8Characters, NPVARIANT_TO_STRING(constructor_str).UTF8Length); -#endif + std::string constructor_name = IcedTeaPluginUtilities::NPVariantAsString(constructor_str); PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str()); @@ -910,6 +893,20 @@ PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url); } +/* Copies a variant data type into a C++ string */ +std::string +IcedTeaPluginUtilities::NPVariantAsString(NPVariant variant) +{ +#if MOZILLA_VERSION_COLLAPSED < 1090200 + return std::string(( + NPVARIANT_TO_STRING(variant).utf8characters, + NPVARIANT_TO_STRING(variant).utf8ength); +#else + return std::string( + NPVARIANT_TO_STRING(variant).UTF8Characters, + NPVARIANT_TO_STRING(variant).UTF8Length); +#endif +} /** * Posts a function for execution on the plug-in thread and wait for result. diff -r 73f6e7fd1446 -r ff8d91a6a006 plugin/icedteanp/IcedTeaPluginUtils.h --- a/plugin/icedteanp/IcedTeaPluginUtils.h Fri Jun 01 16:44:32 2012 -0400 +++ b/plugin/icedteanp/IcedTeaPluginUtils.h Mon Jun 04 12:07:33 2012 -0400 @@ -209,6 +209,9 @@ /* Converts the given integer to a string */ static void itoa(int i, std::string* result); + /* Copies a variant data type into a C++ string */ + static std::string NPVariantAsString(NPVariant variant); + /* Frees the given vector and the strings that its contents point to */ static void freeStringPtrVector(std::vector* v); From adomurad at icedtea.classpath.org Mon Jun 4 09:24:25 2012 From: adomurad at icedtea.classpath.org (adomurad at icedtea.classpath.org) Date: Mon, 04 Jun 2012 16:24:25 +0000 Subject: /hg/icedtea-web: Fix build for older versions of mozilla. (Typo ... Message-ID: changeset bdc092f4b4ff in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=bdc092f4b4ff author: Adam Domurad date: Mon Jun 04 12:24:04 2012 -0400 Fix build for older versions of mozilla. (Typo in untested #ifdef) diffstat: plugin/icedteanp/IcedTeaPluginUtils.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r ff8d91a6a006 -r bdc092f4b4ff plugin/icedteanp/IcedTeaPluginUtils.cc --- a/plugin/icedteanp/IcedTeaPluginUtils.cc Mon Jun 04 12:07:33 2012 -0400 +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc Mon Jun 04 12:24:04 2012 -0400 @@ -900,7 +900,7 @@ #if MOZILLA_VERSION_COLLAPSED < 1090200 return std::string(( NPVARIANT_TO_STRING(variant).utf8characters, - NPVARIANT_TO_STRING(variant).utf8ength); + NPVARIANT_TO_STRING(variant).utf8length); #else return std::string( NPVARIANT_TO_STRING(variant).UTF8Characters, From ddadacha at icedtea.classpath.org Mon Jun 4 10:35:51 2012 From: ddadacha at icedtea.classpath.org (ddadacha at icedtea.classpath.org) Date: Mon, 04 Jun 2012 17:35:51 +0000 Subject: /hg/icedtea-web: Handle absolute paths passed into jnlp_href's v... Message-ID: changeset c2396c2ee991 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c2396c2ee991 author: Danesh Dadachanji date: Mon Jun 04 13:35:25 2012 -0400 Handle absolute paths passed into jnlp_href's value. diffstat: ChangeLog | 14 + netx/net/sourceforge/jnlp/JNLPCreator.java | 35 ++++ netx/net/sourceforge/jnlp/PluginBridge.java | 22 ++- tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java | 99 ++++++++++++++ 4 files changed, 165 insertions(+), 5 deletions(-) diffs (219 lines): diff -r bdc092f4b4ff -r c2396c2ee991 ChangeLog --- a/ChangeLog Mon Jun 04 12:24:04 2012 -0400 +++ b/ChangeLog Mon Jun 04 13:35:25 2012 -0400 @@ -1,3 +1,17 @@ +2012-06-04 Danesh Dadachanji + + Fix to handle absolute paths passed into jnlp_href's value. + * netx/net/sourceforge/jnlp/PluginBridge.java + (PluginBridge): Uses context of codebase to evaluate jnlp_href's value. + Uses JNLPCreator's create method to make new JNLPFile variables. + New constructor that wraps around the original one, creating a new + JNLPCreator to use. + * netx/net/sourceforge/jnlp/JNLPCreator.java: New strategy pattern class + to be used to wrap around the creation of a JNLPFile. Replace this creator + when unit testing to skip running parsing code. + * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: + New class to unit test getEvaluatedJNLPHref. + 2012-06-04 Adam Domurad Added self to AUTHORS. diff -r bdc092f4b4ff -r c2396c2ee991 netx/net/sourceforge/jnlp/JNLPCreator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netx/net/sourceforge/jnlp/JNLPCreator.java Mon Jun 04 13:35:25 2012 -0400 @@ -0,0 +1,35 @@ +/* + * Copyright 2012 Red Hat, Inc. + * This file is part of IcedTea, http://icedtea.classpath.org + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sourceforge.jnlp; + +import java.io.IOException; +import java.net.URL; + +import net.sourceforge.jnlp.cache.UpdatePolicy; + +public class JNLPCreator { + public JNLPFile create(URL location, Version version, boolean strict, + UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException { + return new JNLPFile(location, version, strict, policy, forceCodebase); + } +} diff -r bdc092f4b4ff -r c2396c2ee991 netx/net/sourceforge/jnlp/PluginBridge.java --- a/netx/net/sourceforge/jnlp/PluginBridge.java Mon Jun 04 12:24:04 2012 -0400 +++ b/netx/net/sourceforge/jnlp/PluginBridge.java Mon Jun 04 13:35:25 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright 2007 Red Hat, Inc. + * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -46,10 +46,20 @@ private boolean codeBaseLookup; private boolean useJNLPHref; + /** + * Creates a new PluginBridge using a default JNLPCreator. + */ public PluginBridge(URL codebase, URL documentBase, String jar, String main, int width, int height, Hashtable atts, String uKey) throws Exception { + this(codebase, documentBase, jar, main, width, height, atts, uKey, new JNLPCreator()); + } + + public PluginBridge(URL codebase, URL documentBase, String jar, String main, + int width, int height, Hashtable atts, + String uKey, JNLPCreator jnlpCreator) + throws Exception { specVersion = new Version("1.0"); fileVersion = new Version("1.1"); this.codeBase = codebase; @@ -59,8 +69,10 @@ if (atts.containsKey("jnlp_href")) { useJNLPHref = true; try { - URL jnlp = new URL(codeBase.toExternalForm() + atts.get("jnlp_href")); - JNLPFile jnlpFile = new JNLPFile(jnlp, null, false, JNLPRuntime.getDefaultUpdatePolicy(), this.codeBase); + // Use codeBase as the context for the URL. If jnlp_href's + // value is a complete URL, it will replace codeBase's context. + URL jnlp = new URL(codeBase, atts.get("jnlp_href")); + JNLPFile jnlpFile = jnlpCreator.create(jnlp, null, false, JNLPRuntime.getDefaultUpdatePolicy(), codeBase); Map jnlpParams = jnlpFile.getApplet().getParameters(); info = jnlpFile.info; @@ -76,8 +88,8 @@ } catch (MalformedURLException e) { // Don't fail because we cannot get the jnlp file. Parameters are optional not required. // it is the site developer who should ensure that file exist. - System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm() - + atts.get("jnlp_href")); + System.err.println("Unable to get JNLP file at: " + atts.get("jnlp_href") + + " with context of URL as: " + codeBase.toExternalForm()); } } else { // Should we populate this list with applet attribute tags? diff -r bdc092f4b4ff -r c2396c2ee991 tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java Mon Jun 04 13:35:25 2012 -0400 @@ -0,0 +1,99 @@ +/* + * Copyright 2012 Red Hat, Inc. + * This file is part of IcedTea, http://icedtea.classpath.org + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sourceforge.jnlp; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Hashtable; + +import net.sourceforge.jnlp.cache.UpdatePolicy; + +import org.junit.Test; + +public class PluginBridgeTest { + private class MockJNLPCreator extends JNLPCreator { + + private URL JNLPHref; + + public URL getJNLPHref() { + return JNLPHref; + } + + public JNLPFile create(URL location, Version version, boolean strict, + UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException { + JNLPHref = location; + return new MockJNLPFile(); + } + } + + private class MockJNLPFile extends JNLPFile { + public AppletDesc getApplet() { + return new AppletDesc(null, null, null, 0, 0, new HashMap()); + } + + public ResourcesDesc getResources() { + return new ResourcesDesc(null, null, null, null); + } + } + + @Test + public void testAbsoluteJNLPHref() throws MalformedURLException, Exception { + URL codeBase = new URL("http://undesired.absolute.codebase.com"); + String absoluteLocation = "http://absolute.href.com/test.jnlp"; + Hashtable atts = new Hashtable(); + atts.put("jnlp_href", absoluteLocation); + MockJNLPCreator mockCreator = new MockJNLPCreator(); + PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, atts, "", mockCreator); + assertEquals(absoluteLocation, mockCreator.getJNLPHref().toExternalForm()); + } + + @Test + public void testRelativeJNLPHref() throws MalformedURLException, Exception { + URL codeBase = new URL("http://desired.absolute.codebase.com/"); + String relativeLocation = "sub/dir/test.jnlp"; + Hashtable atts = new Hashtable(); + atts.put("jnlp_href", relativeLocation); + MockJNLPCreator mockCreator = new MockJNLPCreator(); + PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, atts, "", mockCreator); + assertEquals(codeBase.toExternalForm() + relativeLocation, + mockCreator.getJNLPHref().toExternalForm()); + } + + @Test + public void testNoSubDirInCodeBase() throws MalformedURLException, Exception { + String desiredDomain = "http://desired.absolute.codebase.com"; + URL codeBase = new URL(desiredDomain + "/undesired/sub/dir"); + String relativeLocation = "/app/test/test.jnlp"; + Hashtable atts = new Hashtable(); + atts.put("jnlp_href", relativeLocation); + MockJNLPCreator mockCreator = new MockJNLPCreator(); + PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, atts, "", mockCreator); + assertEquals(desiredDomain + relativeLocation, + mockCreator.getJNLPHref().toExternalForm()); + } + +} \ No newline at end of file From ddadacha at redhat.com Mon Jun 4 10:37:36 2012 From: ddadacha at redhat.com (Danesh Dadachanji) Date: Mon, 04 Jun 2012 13:37:36 -0400 Subject: [RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value. In-Reply-To: <4FCCD9F0.5090706@redhat.com> References: <4F5E69D6.9060401@redhat.com> <4F913542.5050500@redhat.com> <4FC66E9C.2080500@redhat.com> <4FC692E7.7000103@redhat.com> <4FCC8EF7.2030505@redhat.com> <4FCCD768.5010402@redhat.com> <4FCCD9F0.5090706@redhat.com> Message-ID: <4FCCF260.8030105@redhat.com> On 04/06/12 11:53 AM, Omair Majid wrote: > On 06/04/2012 11:42 AM, Danesh Dadachanji wrote: >> Too late =) I wasn't too happy with this change either so I hunted down >> a better solution. I noticed some of the tests used JNLPs directly so I >> attempted to integrate that into my test and use the first patch >> (without the evaluation wrapper). However, Omair pointed out that using >> JNLPs is not ideal because this adds test coverage of the parser. So to >> avoid this, I've added the strategy class JNLPCreator that wraps around >> the creation of a JNLPFile. Under netx, it will simply do what it did >> before, create a normal JNLPFile. In the test however, it creates a mock >> JNLP, one that only has the bits my test in particular cares about (e.g. >> location). The additional class in the unit test is there to ensure >> PluginBridge's constructor can run without throwing exceptions. > > Looks good to me. > Thanks! Pushed here: http://icedtea.classpath.org/hg/icedtea-web/rev/c2396c2ee991 Cheers, Danesh From smohammad at redhat.com Mon Jun 4 10:40:34 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Mon, 04 Jun 2012 13:40:34 -0400 Subject: [RFC][icedtea-web]: Configure browser paths Message-ID: <4FCCF312.2020504@redhat.com> Hello, The patch attached allows the user to configure browser paths and/or disable browsers from being used in IcedTea-Web. How it is used (information below can be found using --help): --with-firefox specify the location of firefox or use 'no' as value to disable browser --with-chrome specify the location of chrome or use 'no' as value to disable browser --with-chromium specify the location of chromium or use 'no' as value to disable browser --with-opera specify the location of opera or use 'no' as value to disable browser --with-midori specify the location of midori or use 'no' as value to disable browser --with-epiphany specify the location of epiphany or use 'no' as value to disable browser -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: configureBrowser05.patch Type: text/x-patch Size: 2327 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/2ec6aede/configureBrowser05.patch From smohammad at icedtea.classpath.org Mon Jun 4 10:57:35 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Mon, 04 Jun 2012 17:57:35 +0000 Subject: /hg/icedtea-web: Added signed jnlp file tests Message-ID: changeset 011d695afb1e in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=011d695afb1e author: Saad Mohammad date: Mon Jun 04 13:55:16 2012 -0400 Added signed jnlp file tests diffstat: ChangeLog | 78 ++++++++++ tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp | 65 ++++++++ tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp | 61 +++++++ tests/jnlp_tests/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java | 43 +++++ tests/jnlp_tests/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java | 77 +++++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/aPpLiCaTioN.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/SignedJnlpCase.java | 43 +++++ tests/jnlp_tests/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java | 65 ++++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/SignedJnlpCase.java | 43 +++++ tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java | 65 ++++++++ tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate1.jnlp | 66 ++++++++ tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate2.jnlp | 64 ++++++++ tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate3.jnlp | 71 +++++++++ tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp | 62 +++++++ tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/SignedJnlpTemplate.java | 43 +++++ tests/jnlp_tests/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java | 77 +++++++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication1.jnlp | 54 ++++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication2.jnlp | 56 +++++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication3.jnlp | 57 +++++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp | 62 +++++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/UnsignedJnlpApplication.java | 43 +++++ tests/jnlp_tests/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java | 68 ++++++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate1.jnlp | 54 ++++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate2.jnlp | 56 +++++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate3.jnlp | 57 +++++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp | 62 +++++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/UnsignedJnlpTemplate.java | 43 +++++ tests/jnlp_tests/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java | 68 ++++++++ 35 files changed, 2099 insertions(+), 0 deletions(-) diffs (truncated from 2245 to 500 lines): diff -r c2396c2ee991 -r 011d695afb1e ChangeLog --- a/ChangeLog Mon Jun 04 13:35:25 2012 -0400 +++ b/ChangeLog Mon Jun 04 13:55:16 2012 -0400 @@ -1,3 +1,81 @@ +2012-06-04 Saad Mohammad + + Added signed jnlp file tests. + * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp: + Launching jnlp file that matches the signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp: + * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp: + Launching jnlp file that does not match the signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: + Signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java: + A simple java class that outputs a string. + * tests/jnlp_tests/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java: + Testcase that tests the launching of applications with a signed jnlp + application file. + * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate1.jnlp: + Launching jnlp file that matches the signed jnlp application template file. + * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate2.jnlp: + * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate3.jnlp: + Launching jnlp file that does not match the signed jnlp application + template file. + * tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: + Signed jnlp application template file. + * tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/SignedJnlpTemplate.java: + A simple java class that outputs a string. + * tests/jnlp_tests/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java: + Testcase that tests the launching of applications with a signed jnlp + application template file. + * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication1.jnlp: + Launching jnlp file that matches the unsigned jnlp application file. + * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication2.jnlp: + * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication3.jnlp: + Launching jnlp file that does not match the unsigned jnlp application file. + * tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: + Unsigned jnlp application file. + * tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/UnsignedJnlpApplication.java: + A simple java class that outputs a string. + * tests/jnlp_tests/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java: + Testcase that tests the launching of applications with an unsigned jnlp + application file. + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate1.jnlp: + Launching jnlp file that matches the unsigned jnlp application + template file. + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate2.jnlp: + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate3.jnlp: + Launching jnlp file that does not match the unsigned jnlp application + template file. + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: + Unsigned jnlp application template file. + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/UnsignedJnlpTemplate.java: + A simple java class that outputs a string. + * tests/jnlp_tests/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java: + Testcase that tests the launching of applications with an unsigned jnlp + application template file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp: + Launching jnlp file that matches the signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jnlp: + Launching jnlp file that does not match the signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/aPpLiCaTioN.jnlp: + Signed jnlp application file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/SignedJnlpCase.java: + A simple java class that outputs a string. + * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java: + Testcase that tests the case-sensitivity of the signed jnlp application's + filename. + * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jnlp: + Launching jnlp file that matches the signed jnlp application template file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jnlp: + Launching jnlp file that does not match the signed jnlp application + template file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.jnlp: + Signed jnlp application template file. + * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/SignedJnlpCase.java: + A simple java class that outputs a string. + * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java: + Testcase that tests the case-sensitivity of the signed jnlp application + template's filename. + 2012-06-04 Danesh Dadachanji Fix to handle absolute paths passed into jnlp_href's value. diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,62 @@ + + + + + SignedJnlpApplication + IcedTea + + SignedJnlpApplication + + + + + + + + + + + + + + + + + + diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,65 @@ + + + + + SignedJnlpApplication + IcedTea + + SignedJnlpApplication + + + + + + + + + + + + + + + + + + diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,61 @@ + + + + + SignedJnlpApplication + IcedTea + + SignedJnlpApplication + + + + + + + + + + + + + + diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,62 @@ + + + + + SignedJnlpApplication + IcedTea + + SignedJnlpApplication + + + + + + + + + + + + + + + + + + diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,43 @@ +/* SignedJnlpApplication.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea 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, version 2. + +IcedTea 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 IcedTea; 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. + */ + +public class SignedJnlpApplication { + + public static void main(String[] args) { + System.out.println("Running signed application in main"); + } +} diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,77 @@ +/* SignedJnlpApplicationTest.java +Copyright (C) 2012 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea 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, version 2. + +IcedTea 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 IcedTea; 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. + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; +import org.junit.Test; + +public class SignedJnlpApplicationTest { + + private static ServerAccess server = new ServerAccess(); + private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); + private final String signedException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + + "launching JNLP File"; + + @Test + public void launchingFileMatchesSignedApplication1() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp"); + String s = "Running signed application in main"; + Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); + } + + /** + * Using a different value of name within the 'property' element in the launching JNLP file + */ + @Test + public void launchingFileDoesNotMatchSignedApplication1() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp"); + Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); + } + + /** + * Missing 'property' child element within 'resource' in the launching JNLP file + */ + @Test + public void launchingFileDoesNotMatchSignedApplication2() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp"); + Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); + } +} \ No newline at end of file diff -r c2396c2ee991 -r 011d695afb1e tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp Mon Jun 04 13:55:16 2012 -0400 @@ -0,0 +1,62 @@ + + +

+ + +

+ + diff -r e619314cd84d -r a78024e7139f tests/jnlp_tests/simple/AppletTakesLastParam/resources/appletTakesLastParam.jnlp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/simple/AppletTakesLastParam/resources/appletTakesLastParam.jnlp Mon Jun 04 15:10:20 2012 -0400 @@ -0,0 +1,63 @@ + + + + + AppletTakesLastParam + IcedTea + + AppletTakesLastParam + + + + + + + + + + + + + + diff -r e619314cd84d -r a78024e7139f tests/jnlp_tests/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java Mon Jun 04 15:10:20 2012 -0400 @@ -0,0 +1,63 @@ + +import java.applet.Applet; + +/* AppletTest.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea 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, version 2. + +IcedTea 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 IcedTea; 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. + */ +public class AppletTakesLastParam extends Applet { + + private class Killer extends Thread { + + public int n = 2000; + + @Override + public void run() { + try { + Thread.sleep(n); + System.out.println("Applet killing itself after " + n + " ms"); + System.exit(0); + } catch (Exception ex) { + } + } + } + private Killer killer = new Killer(); + + @Override + public void init() { + System.out.println(getParameter("param")); + killer.start(); + } +} diff -r e619314cd84d -r a78024e7139f tests/jnlp_tests/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/jnlp_tests/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java Mon Jun 04 15:10:20 2012 -0400 @@ -0,0 +1,66 @@ +/* AppletTestTests.java +Copyright (C) 2011 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea 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, version 2. + +IcedTea 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 IcedTea; 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. + */ + +import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.ServerAccess.ProcessResult; +import org.junit.Assert; + +import org.junit.Test; + +public class AppletTakesLastParamTests { + + private static ServerAccess server = new ServerAccess(); + + @Test + public void AppletTest() throws Exception { + ServerAccess.ProcessResult pr = server.executeJavaws(null, "/appletTakesLastParam.jnlp"); + evaluateApplet(pr); + } + + private void evaluateApplet(ProcessResult pr) { + String s0 = "value1"; + Assert.assertTrue("AppletTakesLastParam stdout should not contain " + s0 + " but did.", !pr.stdout.contains(s0)); + String s1 = "value2"; + Assert.assertTrue("AppletTakesLastParam stdout should contain " + s1 + " but did not.", pr.stdout.contains(s1)); + } + + @Test + public void AppletInFirefoxTest() throws Exception { + ServerAccess.ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html"); + evaluateApplet(pr); + } +} From bugzilla-daemon at icedtea.classpath.org Mon Jun 4 12:31:54 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 04 Jun 2012 19:31:54 +0000 Subject: [Bug 1027] New: DownloadService is not supported by IcedTea-Web Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1027 Priority: P3 Bug ID: 1027 CC: smohammad at redhat.com, unassigned at icedtea.classpath.org Assignee: unassigned at icedtea.classpath.org Summary: DownloadService is not supported by IcedTea-Web Severity: normal Classification: Unclassified OS: Linux Reporter: ddadacha at redhat.com Hardware: x86_64 Status: NEW Version: unspecified Component: General Product: IcedTea-Web Webstart and plugin are missing DownloadService and DownloadService2: http://docs.oracle.com/javase/7/docs/jre/api/javaws/jnlp/javax/jnlp/DownloadService.html http://docs.oracle.com/javase/7/docs/jre/api/javaws/jnlp/javax/jnlp/DownloadService2.html -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/cbb95b90/attachment.html From bugzilla-daemon at icedtea.classpath.org Mon Jun 4 12:32:52 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Mon, 04 Jun 2012 19:32:52 +0000 Subject: [Bug 1028] New: ExtensionInstallerService is not supported by IcedTea-Web Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1028 Priority: P3 Bug ID: 1028 CC: smohammad at redhat.com, unassigned at icedtea.classpath.org Assignee: unassigned at icedtea.classpath.org Summary: ExtensionInstallerService is not supported by IcedTea-Web Severity: normal Classification: Unclassified OS: Linux Reporter: ddadacha at redhat.com Hardware: x86_64 Status: NEW Version: unspecified Component: General Product: IcedTea-Web Webstart and plugin do not yet support ExtensionInstallerService: http://docs.oracle.com/javase/7/docs/jre/api/javaws/jnlp/javax/jnlp/ExtensionInstallerService.html -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/12a0b8cf/attachment.html From omajid at redhat.com Mon Jun 4 12:53:51 2012 From: omajid at redhat.com (Omair Majid) Date: Mon, 04 Jun 2012 15:53:51 -0400 Subject: [rfc][icedtea-web] known to fail annotation In-Reply-To: <4FBCFB37.5000109@redhat.com> References: <4FB11904.1000408@redhat.com> <4FB26531.7010104@redhat.com> <4FB26C97.4030108@redhat.com> <4FB26E05.6060104@redhat.com> <4FB271F6.2050807@redhat.com> <4FBB8D18.5040505@redhat.com> <4FBBCD37.7060806@redhat.com> <4FBCFB37.5000109@redhat.com> Message-ID: <4FCD124F.90701@redhat.com> On 05/23/2012 10:59 AM, Jiri Vanek wrote: > On 05/22/2012 07:30 PM, Omair Majid wrote: >> On 05/22/2012 08:56 AM, Jiri Vanek wrote: >>> As agreed on IRC, Percentage removed. What do you think now? >> >> I am wondering what really differentiates KnownToFail from Ignore, aside >> from the fact that we are processing the KnownToFail annotation. But we >> could do the same for Ignore, right? Is it that tests makred with Ignore >> are not run while tests marked with KnownToFail are run? > > Yes. This is crucial difference. >> >> Something I am unclear about. Say I have this test case: >> >> class TestCase { >> @Test >> @KnownToFail >> public void someTestMethod() throws Exception { >> assertTrue(false); >> } >> } >> >> What stat do you think should be printed? >> >> Passed: 0, Failed: 1, Ignored: 0 >> >> or >> >> Passed: 0, Failed: 0, Ignored: 1 >> (with something to indicate the exepected failure?) > > Well this is correct question. You saw my outputs below. (to print it as > failed, and print somewhere that those are supposed to fail) Are you ok > with them? > Yeah, a separate line should be fine for now. I think it would be better to have just one line with the result summarized. It's faster for humans to read and interpret. But I am not sure how to reconcile that with a known reproducer that passes (or other strange cases like that). >>> diff -r 1088b2dffe49 tests/junit-runner/JunitLikeXmlOutputListener.java >>> --- a/tests/junit-runner/JunitLikeXmlOutputListener.java Tue May >>> 22 12:08:17 2012 +0200 >>> +++ b/tests/junit-runner/JunitLikeXmlOutputListener.java Tue May >>> 22 14:32:43 2012 +0200 >> >>> @@ -45,6 +47,7 @@ >>> private static final String TEST_ELEMENT = "testcase"; >>> private static final String BUGS = "bugs"; >>> private static final String BUG = "bug"; >>> + private static final String K2F = "knownToFail"; >> >> A more xml-like version might be "known-to-fail" ;) > > done (although I don`t like this convention ;) Well, this is a subjective issue. So if you dont like it, please change it back to something you are happy with :) >>> + } catch (Exception ex) { >>> + ex.printStackTrace(); >>> + } >>> + Map testcaseAtts = new HashMap>> String>(4); >>> NumberFormat formatter = new DecimalFormat("#0.0000"); >>> String stringedTime = formatter.format(testTimeSeconds); >>> stringedTime.replace(",", "."); >> >> This replacement of comma with a dot looks strange. It looks like >> something that should be handled by the localization code. > > It is not related to this patch, I have not find quick way of fix. > Adding to my todo! Right. Sorry, I should have been clearer - I pointed out issues that weren't related to your patch. You dont have to fix them (or explain thme) in your patch. >> This is probably the best argument I can point to for renaming >> ClassCounter to ClassStat ;) > > done - although did patch little bit messy. I didn't mean to imply that you have to do it in this patch :) You can split it out/do it later, if you want. >> Anyway, please rename cc to "classStat" "testStat" or something. > done! >> >>> @@ -45,7 +60,56 @@ >>> int passed = result.getRunCount() - >>> result.getFailureCount() - result.getIgnoreCount(); >>> int failed = result.getFailureCount(); >>> int ignored = result.getIgnoreCount(); >>> - writer.println("Test results: passed: " + passed + "; >>> failed: " + failed + "; ignored: " + ignored); >>> + writer.println("Test results ("+result.getRunCount()+"): >>> passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); >>> + writer.println("Test known to fail ("+totalK2F+"): passed: " >>> + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); >>> + } >> >> Are the builders prepared to handle this change in output? > I have swap the lines so they will be affected with less probability. On > my side (daily report) they will be ok. Where's that? ;) Only asking because I dont think you make it avaiable publicly. > Who should I notify/where what > to verify for builders on classpath.org? The only public instance that I know of is mjw's testers. You can see what the testers do here: http://icedtea.classpath.org/hg/buildbot/file/05e41e1c037b/icedtea/master.cfg#l157 >>> diff -r 1088b2dffe49 tests/report-styles/jreport.xsl >>> --- a/tests/report-styles/jreport.xsl Tue May 22 12:08:17 2012 +0200 >>> +++ b/tests/report-styles/jreport.xsl Tue May 22 14:32:43 2012 +0200 >>> @@ -53,11 +53,17 @@ >>> >>>
>>>

Result: (>> select="round(sum(/testsuite/testcase/@time))"/>s)

>>> +

In brackets are KnownToFail values if any

>> >> Might be nicer if we just leave this description out and display >> "expected:" or "known:" in the brackets. > > hmhm.. Actually I don know... It it will not be nice to have > > total 10 (from which 8 known to fail) > passed 5 (but 4 are know to fail) > failed 3 (and 3 known to fail) > ignored 2 (one known to fail) > > To much words... But can be more descriptive. What do you think? > I left my original one in patch. Okay, fair enough. >>> @@ -65,6 +71,11 @@ >>>
passed:
>>>
>>> >>> + >>> + >>> + (>> select="/testsuite/stats/summary/passed/@knownToFail"/>) >>> + >>> + >> >> I am having trouble parsing this. Are these tests that are known to fail >> that passed? Should we be flagging this more importantly? >> > This should not happen, but it can happe:). Eg some patch fill fix some > secondary issue unwillingly, so author will be noticed. > Or programmer just forget that some more tests corresponding to his > patch have this annotation. > > explained? Okay, but surely we should be flagging this as important so the developer can remove the @KnownToFail annotation? >>> diff -r 1088b2dffe49 >>> tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java >>> >>> --- /dev/null Thu Jan 01 00:00:00 1970 +0000 >>> +++ >>> b/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java >>> Tue May 22 14:32:43 2012 +0200 >> >>> +/** >>> + * This annotation should be declared for each test which is >>> representing an issue >>> + * where icedtea-web is not doing as correctly as expected, and so >>> the test, by its failure, >>> + * is showing this behaviour. >>> + * If the issue is fixed, annotation should be removed. >>> + * >>> + */ >> >> How about: >> >> """ >> This annotation marks a test as a known failure (as opposed to a >> regression). A test that is a known failure will not hold of a release, ^^ That "of" should have been "off". Sorry; my mistake. > diff -r 1088b2dffe49 tests/junit-runner/LessVerboseTextListener.java > --- a/tests/junit-runner/LessVerboseTextListener.java Tue May 22 12:08:17 2012 +0200 > +++ b/tests/junit-runner/LessVerboseTextListener.java Wed May 23 16:41:21 2012 +0200 > @@ -45,7 +60,56 @@ > int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); > int failed = result.getFailureCount(); > int ignored = result.getIgnoreCount(); > - writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); > + writer.println("Test known to fail ("+totalK2F+"): passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); > + writer.println("Test results ("+result.getRunCount()+"): passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); > + } Please leave the original line ("Test results: passed:"..) unchanged (unless you are going to combine the two lines). Otherwise, this looks fine to me. Cheers, Omair From ddadacha at redhat.com Mon Jun 4 14:53:59 2012 From: ddadacha at redhat.com (Danesh Dadachanji) Date: Mon, 04 Jun 2012 17:53:59 -0400 Subject: [RFC][icedtea-web] Fix for PR855: AppletStub getDocumentBase() doesn't return full URL In-Reply-To: <4FB6131F.50004@redhat.com> References: <4F2C425B.2040805@redhat.com> <20120416171814.GB14177@redhat.com> <4FB56AA4.6080205@redhat.com> <4FB6131F.50004@redhat.com> Message-ID: <4FCD2E77.7030901@redhat.com> On 18/05/12 05:15 AM, Jiri Vanek wrote: > On 05/17/2012 11:16 PM, Danesh Dadachanji wrote: >> >> On 16/04/12 01:18 PM, Deepak Bhole wrote: >>> * Danesh Dadachanji [2012-02-03 15:40]: >>>> Hi, >>>> >>>> This patch is a fix for PR855[1]. The return of getDocumentBase() >>>> currently doesn't include the HTML file. According to the docs, it >>>> should return the entire path of the HTML, including the filename. >>>> >>>> Attached is a patch that adds this. I've checked all the traces of >>>> the bytes grabbed from the pipe over on the java side. I believe I >>>> covered every read and assignment of the buffer/vars setup from the >>>> buffer and so on. We fortunately only ever used getDocumentBase()'s >>>> return to grab the host IP or use it as a base URL. The latter code >>>> grabbed the return and cut off everything after the last '/', which >>>> back before patch is the entire URL, post patch is the URL excluding >>>> the file name. >>>> >>>> Okay for HEAD? Thoughts on backporting to release branches? It was >>>> reported against 1.1.3 but this is a pretty big change that >>>> potentially affects the way users' applications behave. >>>> >>> >>> Looking at the surrounding code, we are taking a URL, splitting it on >>> "/" and then combining the first length-1 components. This was done to >>> purposely remove the file name itself. >>> >>> However if we want to add the file name back, we should just remove all >>> of the splitting/combing code rather than appending the last part. >>> >>> Have you tried using NPVARIANT_TO_STRING(href).utf8characters directly? >>> >> >> Ah yes I wasn't paying attention to the surrounding code :S >> >> How's this look? I'd like to backport this to 1.2 as well. The reporter uses 1.1.3 though so perhaps >> it should go into 1.1 too? Thoughts? >> >> Cheers, >> Danesh > Can we get also test for this? :( Here we go. =) Since there was a long delay in this (sorry!), the original file has changed quite a bit in the last few days, I have been waiting for those to go in so I could update mine accordingly. Please note the new changes! I've added a test for this and a test for checking what codebase should be. I also threw in an extra jnlp_href test because we don't have one! 3 tests with one stone. ;) I also took the opportunity to make some minor typos/mistakes in AppletTest's asserts. ChangeLog: +2012-06-04 Danesh Dadachanji + + PR855: AppletStub getDocumentBase() doesn't return full URL + * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): + Assign documentbase_copy directly to href's value instead of iterating + through the segments to remove the file from the path. + * tests/jnlp_tests/simple/AppletTest/srcs/AppletTest.java: + Added prints of codebase and document base when initializing. + * tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java: + (evaluateApplet): New param baseName, represents the HTML file name + when calling applet.getDocumentBase(). + * tests/jnlp_tests/simple/AppletTest/resources/appletJNLPHrefTest.html: + New test that runs AppletTest via jnlp_href. + I would still like to backport this to 1.2 but it may require me backporting the fixes for PR518 and PR863. I'm unsure if it needs to go to 1.1, the reporter said they used 1.1 though. Thoughts? Cheers, Danesh -------------- next part -------------- A non-text attachment was scrubbed... Name: get-document-base-03.patch Type: text/x-patch Size: 8456 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120604/c7892079/get-document-base-03.patch From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 00:54:25 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 07:54:25 +0000 Subject: [Bug 1029] New: Error in web access to HP procurve switches Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1029 Priority: P3 Bug ID: 1029 CC: unassigned at icedtea.classpath.org Assignee: dbhole at redhat.com Summary: Error in web access to HP procurve switches Severity: normal Classification: Unclassified OS: Linux Reporter: jpcozar at yahoo.es Hardware: x86_64 Status: NEW Version: 1.2 Component: Plugin Product: IcedTea-Web Created attachment 700 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=700&action=edit Error accessing to hp procurve switches Hello, My OS is Ubuntu 12.04 and my version plugin is icedtea-6-plugin 1.2-2ubuntu1. When I try to access to HP Procurve switches via web, an error is produced in Chrome, Versi?n 19.0.1084.52, (attached image) and Firefox freezes. Web Access to these switches has worked in the pas with sun-java under Ubuntu (and naturally it works in OS Windows + sun-java). If any other information is needed, just let me know. Thank you in advance. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/2c952ea1/attachment.html From phatina at redhat.com Tue Jun 5 01:15:05 2012 From: phatina at redhat.com (Peter Hatina) Date: Tue, 5 Jun 2012 10:15:05 +0200 Subject: [PATCH] Introduced --with-gtk option for configure.ac Message-ID: <1338884105-12356-1-git-send-email-phatina@redhat.com> Review, please. Peter Hatina EMEA ENG-Desktop Development Red Hat Czech, Brno --- ChangeLog | 8 ++++++++ NEWS | 1 + acinclude.m4 | 40 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 82c0feb..f1d97bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-05-28 Peter Hatina + + Introduced configure option --with-gtk=2|3|default to be able + to compile against different version of GTK+ (2.x or 3.x). + * NEWS: mentioned bug fix + * acinclude.m4: (ITW_GTK_CHECK_VERSION) macro for getting GTK+ version + (ITW_GTK_CHECK) macro for checking GTK+ version + 2012-05-02 Jiri Vanek Introduced new annotations Bug (to connect test/reproducer with documentation) diff --git a/NEWS b/NEWS index 8397639..cf2a54e 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ New in release 1.3 (2012-XX-XX): - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass * Common - PR918: java applet windows uses a low resulution black/white icon + - RH720836: project can be compiled against GTK+ 2 or 3 libraries New in release 1.2 (2011-XX-XX): * Security updates: diff --git a/acinclude.m4 b/acinclude.m4 index a330d0f..a2eafd0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -359,13 +359,51 @@ AC_ARG_ENABLE([plugin], AC_MSG_RESULT(${enable_plugin}) ]) +dnl ITW_GTK_CHECK_VERSION([gtk version]) +AC_DEFUN([ITW_GTK_CHECK_VERSION], +[ + AC_MSG_CHECKING([for GTK$1 version]) + GTK_VER=`$PKG_CONFIG --modversion gtk+-$1.0` + AC_MSG_RESULT([$GTK_VER]) +]) + +dnl ITW_GTK_CHECK([gtk version]) +AC_DEFUN([ITW_GTK_CHECK], +[ + case "$1" in + default) + PKG_CHECK_MODULES(GTK, gtk+-3.0, + [ITW_GTK_CHECK_VERSION([3])], + [PKG_CHECK_MODULES(GTK, gtk+-2.0, + [ITW_GTK_CHECK_VERSION([2])], + [AC_MSG_ERROR([GTK not found])] + )] + ) + ;; + *) + PKG_CHECK_MODULES(GTK, gtk+-$1.0, + [ITW_GTK_CHECK_VERSION([$1])], + [AC_MSG_ERROR([GTK not found])] + ) + ;; + esac +]) + AC_DEFUN_ONCE([IT_CHECK_PLUGIN_DEPENDENCIES], [ dnl Check for plugin support headers and libraries. dnl FIXME: use unstable AC_REQUIRE([IT_CHECK_PLUGIN]) if test "x${enable_plugin}" = "xyes" ; then - PKG_CHECK_MODULES(GTK, gtk+-2.0) + AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk=[2|3|default]], + [the GTK+ version to use (default: 3)])], + [case "$with_gtk" in + 2|3|default) ;; + *) AC_MSG_ERROR([invalid GTK+ version specified]) ;; + esac], + [with_gtk=default]) + ITW_GTK_CHECK([$with_gtk]) PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) -- 1.7.10.2 From jvanek at redhat.com Tue Jun 5 05:03:34 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 14:03:34 +0200 Subject: [rfc][icedtea-web] reproducer for RH816592 (and PR858) In-Reply-To: <4FA152A2.1030600@redhat.com> References: <4FA152A2.1030600@redhat.com> Message-ID: <4FCDF596.1000209@redhat.com> This test contains six tests. All are failing. Two applets in html, two applets in jnlp and two applications in jnlp Three "new" variants are about to be fixed by little bit modified Thomas' patch[1] three "hack" variants are about to be fixed by my patch [2] All tests are also representing nullpointer exception fixed recently [3] Thomas fix have also fixed GeoGebra issue, so I have marked just "new" variants as reproducers for RH816592/PR858 as the "hack" test are reproducing little bit stronger missuses. [1]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018824.html [2]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018372.html [3]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018813.html Thomas do you think this reproducer is enough to simulate yours patch to-be-fixed-issue? 2012-05-06 Jiri Vanek Reproducer for RH816592 * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-hack.jnlp jnlp launcher of applet variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-new.jnlp jnlp launcher of applet variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.html html launcher of applet variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.jnlp jnlp launcher of application variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.html html launcher of applet variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.jnlp jnlp launcher of application variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/srcs/InternalClassloaderWithDownloadedResource.java: Both application and applet reproducing behavior of this bug * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java: Testcase launching jnlp application, jnlp applet and html applet -------------- next part -------------- A non-text attachment was scrubbed... Name: betterRH816592reproducer.diff Type: text/x-patch Size: 30342 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/b21f7c59/betterRH816592reproducer.diff From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 05:09:24 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 12:09:24 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 Jaroslav Reznik changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jreznik at redhat.com --- Comment #21 from Jaroslav Reznik --- I can reproduce it too with icedtea-web-1.2-2 as found in F17, direct connection. With same logs, URLs with jars are accessible by browser/wget. So probably it gets mangled some way. Why the plugin is trying to connect to mojebanka:443 with plain http? A lot of users confirmed this behaviour on our Czech forum (once it got widespread in F17). -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/61bb5530/attachment.html From jvanek at redhat.com Tue Jun 5 05:15:46 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 14:15:46 +0200 Subject: [RFC][icedtea-web] Fix for PR855: AppletStub getDocumentBase() doesn't return full URL In-Reply-To: <4FCD2E77.7030901@redhat.com> References: <4F2C425B.2040805@redhat.com> <20120416171814.GB14177@redhat.com> <4FB56AA4.6080205@redhat.com> <4FB6131F.50004@redhat.com> <4FCD2E77.7030901@redhat.com> Message-ID: <4FCDF872.9010903@redhat.com> On 06/04/2012 11:53 PM, Danesh Dadachanji wrote: > On 18/05/12 05:15 AM, Jiri Vanek wrote: >> On 05/17/2012 11:16 PM, Danesh Dadachanji wrote: >>> >>> On 16/04/12 01:18 PM, Deepak Bhole wrote: >>>> * Danesh Dadachanji [2012-02-03 15:40]: >>>>> Hi, >>>>> >>>>> This patch is a fix for PR855[1]. The return of getDocumentBase() >>>>> currently doesn't include the HTML file. According to the docs, it >>>>> should return the entire path of the HTML, including the filename. >>>>> >>>>> Attached is a patch that adds this. I've checked all the traces of >>>>> the bytes grabbed from the pipe over on the java side. I believe I >>>>> covered every read and assignment of the buffer/vars setup from the >>>>> buffer and so on. We fortunately only ever used getDocumentBase()'s >>>>> return to grab the host IP or use it as a base URL. The latter code >>>>> grabbed the return and cut off everything after the last '/', which >>>>> back before patch is the entire URL, post patch is the URL excluding >>>>> the file name. >>>>> >>>>> Okay for HEAD? Thoughts on backporting to release branches? It was >>>>> reported against 1.1.3 but this is a pretty big change that >>>>> potentially affects the way users' applications behave. >>>>> >>>> >>>> Looking at the surrounding code, we are taking a URL, splitting it on >>>> "/" and then combining the first length-1 components. This was done to >>>> purposely remove the file name itself. >>>> >>>> However if we want to add the file name back, we should just remove all >>>> of the splitting/combing code rather than appending the last part. >>>> >>>> Have you tried using NPVARIANT_TO_STRING(href).utf8characters directly? >>>> >>> >>> Ah yes I wasn't paying attention to the surrounding code :S >>> >>> How's this look? I'd like to backport this to 1.2 as well. The reporter uses 1.1.3 though so perhaps >>> it should go into 1.1 too? Thoughts? >>> >>> Cheers, >>> Danesh >> Can we get also test for this? :( > > Here we go. =) Since there was a long delay in this (sorry!), the original file has changed quite a bit in the last few days, I have been waiting for those to go in so I could update mine accordingly. Please note the new changes! > > I've added a test for this and a test for checking what codebase should be. I also threw in an extra jnlp_href test because we don't have one! 3 tests with one stone. ;) > > I also took the opportunity to make some minor typos/mistakes in AppletTest's asserts. > > ChangeLog: > +2012-06-04 Danesh Dadachanji > + > + PR855: AppletStub getDocumentBase() doesn't return full URL > + * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): > + Assign documentbase_copy directly to href's value instead of iterating > + through the segments to remove the file from the path. > + * tests/jnlp_tests/simple/AppletTest/srcs/AppletTest.java: > + Added prints of codebase and document base when initializing. > + * tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java: > + (evaluateApplet): New param baseName, represents the HTML file name > + when calling applet.getDocumentBase(). > + * tests/jnlp_tests/simple/AppletTest/resources/appletJNLPHrefTest.html: > + New test that runs AppletTest via jnlp_href. > + > > I would still like to backport this to 1.2 but it may require me backporting the fixes for PR518 and PR863. I'm unsure if it needs to go to 1.1, the reporter said they used 1.1 though. Thoughts? I think there should be no issue with backporting and also cc part of code looks ok. But I have one bigger issue with test - do you think it can be separated reproducer? I know they will be very similar but I would like have each reproducer to simulate as little as possible. Also do not forget to add @Bug(id="PR855") to the testcase class and test method;) Also please be sure to use new logging functions (I guess you have reviewed them;) instead of all stdout/err in testcaes (not reproducer itself) and do no reprint stdout of processes. (I doubt the code you have used as stub exist anymore...) Also there is no need to change timeout in your new reproducer. Thanx again for patch and test! J. > > Cheers, > Danesh From jvanek at redhat.com Tue Jun 5 05:26:11 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 14:26:11 +0200 Subject: [icedtea-web] RFC: Fix pac tests In-Reply-To: <4F7AAB7E.2040902@redhat.com> References: <4F6D7437.8010804@redhat.com> <4F70A806.8060108@redhat.com> <4F70ADA7.2060707@redhat.com> <4F716946.5060900@redhat.com> <4F71DBE0.6040105@redhat.com> <4F7AAB7E.2040902@redhat.com> Message-ID: <4FCDFAE3.7080206@redhat.com> On 04/03/2012 09:49 AM, Jiri Vanek wrote: > On 03/27/2012 05:25 PM, Omair Majid wrote: >> On 03/27/2012 03:16 AM, Jiri Vanek wrote: >>> Among the wrapping and other fixing you did are several times just >>> fixes of indentation. Do you mind to push those fixes separately and >>> repost the fixes you did again? >> >> Ah. Sorry for that. How does the new patch look? The file uses a really >> strange mix of tabs and spaces (both 4 and 2) for indentation, making it >> really hard to write code that fits in with the existing indentation. I >> hope I have the changes right this time. >> >> Thanks, >> Omair >> > > Yap. I think this can go in. > Tyvm again! > J. > It looks like something is still leaking - http://10.34.2.200/icedtea-web-dailyreport/ICWDR_1338437499/index.html I suspect it will have `conection with 31/1 :( MAybe it is just May specific issue;) J. From jvanek at redhat.com Tue Jun 5 05:51:28 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 14:51:28 +0200 Subject: [rfc][icedtea-web] known to fail annotation In-Reply-To: <4FCD124F.90701@redhat.com> References: <4FB11904.1000408@redhat.com> <4FB26531.7010104@redhat.com> <4FB26C97.4030108@redhat.com> <4FB26E05.6060104@redhat.com> <4FB271F6.2050807@redhat.com> <4FBB8D18.5040505@redhat.com> <4FBBCD37.7060806@redhat.com> <4FBCFB37.5000109@redhat.com> <4FCD124F.90701@redhat.com> Message-ID: <4FCE00D0.5070904@redhat.com> On 06/04/2012 09:53 PM, Omair Majid wrote: > On 05/23/2012 10:59 AM, Jiri Vanek wrote: >> On 05/22/2012 07:30 PM, Omair Majid wrote: >>> On 05/22/2012 08:56 AM, Jiri Vanek wrote: >>>> As agreed on IRC, Percentage removed. What do you think now? ...snip .. >> diff -r 1088b2dffe49 tests/junit-runner/LessVerboseTextListener.java >> --- a/tests/junit-runner/LessVerboseTextListener.java Tue May 22 12:08:17 2012 +0200 >> +++ b/tests/junit-runner/LessVerboseTextListener.java Wed May 23 16:41:21 2012 +0200 > >> @@ -45,7 +60,56 @@ >> int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); >> int failed = result.getFailureCount(); >> int ignored = result.getIgnoreCount(); >> - writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); >> + writer.println("Test known to fail ("+totalK2F+"): passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); >> + writer.println("Test results ("+result.getRunCount()+"): passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); >> + } Do you mind to have total/totalKnownToFail line here? So the three lines will be total know to fail sumary unchanged last line as you wanted =~ writer.println("Total tests "+result.getRunCount()+"/ known to fail tests "+totalK2F); writer.println("Test known to fail: passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); > > Please leave the original line ("Test results: passed:"..) unchanged > (unless you are going to combine the two lines). > > Otherwise, this looks fine to me. Is this approve? :D > > Cheers, > Omair From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 06:05:43 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 13:05:43 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 --- Comment #22 from timothyhobbs at seznam.cz --- Sadly, I too am back to using the Oracle JRE on Arch linux... So this bug appears to either still exist, or exist again. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/2d014f97/attachment.html From jvanek at redhat.com Tue Jun 5 06:10:39 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 15:10:39 +0200 Subject: [RFC][icedtea-web][rhino] added tests for corner cases of dateRange and enabled testWeekdayRange In-Reply-To: <4FC3CD9C.8070109@redhat.com> References: <4EB92EFA.9000601@redhat.com> <4EBAB6E4.3030606@redhat.com> <4EBBB198.4080400@redhat.com> <4FBBD166.5010201@redhat.com> <4FBCD173.1020603@redhat.com> <4FC3CD9C.8070109@redhat.com> Message-ID: <4FCE054F.9020104@redhat.com> On 05/28/2012 09:10 PM, Omair Majid wrote: > On 05/23/2012 08:00 AM, Jiri Vanek wrote: >> On 05/22/2012 07:48 PM, Omair Majid wrote: >>> On 11/10/2011 06:12 AM, Jiri Vanek wrote: >>>> Attached is patch with fixed indentation >>> >>> Well, turns out that this isn't quite true :( >>> >>>> - // note: watch out for wrapping around of dates. date ranges, like >>>> - // month=9 to month=8, wrap around and cover the entire year. this >>>> - // makes everything more interesting >>>> + function isDateInRange() { >>> >>> I completely missed that this makes isDateInRange a top-level function. >>> I intentionally wanted to avoid this; this script now exposes this >>> (unexpected) function to all the proxy auto config scripts. I can >>> imagine all sorts of name clashes if a script accidentally defines a >>> function with the same name. Can we fix this somehow while still keeping >>> the testing benefits? >> >> Well javascript private-members is painful theme. Just google around and >> you will get scared. What just about to rename it? >> I will need some nasty refactoring and prototyping which have its >> disadvantages. >> >> isDateInRange -> diuaseOUIUHroigjodHPffg484gfjfg ? :) >> >> or better >> isDateInRange -> isDateInRange_internallForIcedTeaWebTesting ? > > There are no guarantees that these wont clash either, especially if > someone is trying to make that happen :( > > Still, it's better than what we have now. So go for it! > > Omair here we are 2012-06-05 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: and * tests/netx/pac/pac-funcs-test.js: isDateInRange renamed to isDateInRange_internallForIcedTeaWebTesting Cheers J. -------------- next part -------------- A non-text attachment was scrubbed... Name: renamedIsDateInRange.diff Type: text/x-patch Size: 4348 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/1a10c884/renamedIsDateInRange.diff From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 06:08:10 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 13:08:10 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 --- Comment #23 from timothyhobbs at seznam.cz --- Just one question for Jaroslav Reznik. Do you know if the other Czech users are all 64 bit, or if there is a mix of 32 and 64 bit systems with the problem? -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/53efb9df/attachment.html From dbhole at redhat.com Tue Jun 5 06:53:41 2012 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 5 Jun 2012 09:53:41 -0400 Subject: [icedtea-web] RFC: Patch for PR861: Code in a jar cannot connect to jar host server In-Reply-To: <4FCC9142.8090505@redhat.com> References: <20120528171606.GP29866@redhat.com> <4FCC9142.8090505@redhat.com> Message-ID: <20120605135338.GA30821@redhat.com> * Jiri Vanek [2012-06-04 06:39]: > On 05/28/2012 07:16 PM, Deepak Bhole wrote: > >Hi, > > > >Attached patch resolves PR861: > >http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 > > > >ChangeLog: > >2012-05-28 Deepak Bhole > > > > PR861: Allow loading from non codebase hosts. Allow code to connect to > > hosting server. > > * netx/net/sourceforge/jnlp/SecurityDesc.java > > (getSandBoxPermissions): Only add host if it is not empty. > > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > > (getPermissions): Add SocketPermission for code source host. > > (findLoadedClassAll): Call super methods privileged so that connection to > > non codebase hosts can be made. > > (findClass): Same. > > (findResourcesBySearching): Same. Also use privileged context for enum > > operations because the enum is defined on the fly by URLClassLoader and > > checks for hosting server connectivity via next(). > > (getAccessControlContextForClassLoading): New method. Returns a control > > context for classloader operations like find/load/etc. > > (CodeBaseClassLoader::findClass): Call super methods privileged so that > > connection to non codebase hosts can be made. > > (CodeBaseClassLoader::findResource): Same. > > > >Applets may specify jars from different host servers. The current code only > >allows socket connect permissions for codebase. This is insufficient as a class > >from one jar may need a class from another jar that is hosted on a different > >server. > > > >Furthermore, if a class comes from server foo, it should be allowed to connect > >to foo throughout its lifetime. > > > >Attached patch resolves the above issues and makes the site mentioned in the > >bug (http://broadband.mpi-sws.org/transparency/glasnost.php) work again. > > > >OK for HEAD? > > > >Cheers, > >Deepak > > Hi! > I have walked across the code and looks ok. > Two questions inline. > > Btw - can you suggest me a bit How I can write an reproducer? > > There is ability in current framework to run several wirtual servers on "different urls" by different ports. > So you can run application from localhost:1234 and downlaod resource from localhsot:56789. Will this be enough for this testing ( I will elaborate on this reproducers) > Hi Jiri, Different URLs will not be enough unfortunately. We will need different DNSs to reproduce this :( Is the patch itself OK to push btw? Cheers, Deepak > > > > > >PR861.patch > > > > > >diff -r 6df151bb5320 NEWS > >--- a/NEWS Fri May 25 11:44:13 2012 -0400 > >+++ b/NEWS Mon May 28 13:11:12 2012 -0400 > >@@ -15,6 +15,7 @@ > > * Plugin > > - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp > > - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass > >+ - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server. > > * Common > > - PR918: java applet windows uses a low resulution black/white icon > > > >diff -r 6df151bb5320 netx/net/sourceforge/jnlp/SecurityDesc.java > >--- a/netx/net/sourceforge/jnlp/SecurityDesc.java Fri May 25 11:44:13 2012 -0400 > >+++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Mon May 28 13:11:12 2012 -0400 > >@@ -238,7 +238,7 @@ > > for (int i = 0; i< jnlpRIAPermissions.length; i++) > > permissions.add(jnlpRIAPermissions[i]); > > > >- if (downloadHost != null) > >+ if (downloadHost != null&& downloadHost.length()> 0) > > permissions.add(new SocketPermission(downloadHost, > > "connect, accept")); > > You are adding privileges - shouldn't application request for SocketPermission itself? > > > >diff -r 6df151bb5320 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > >--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri May 25 11:44:13 2012 -0400 > >+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon May 28 13:11:12 2012 -0400 > >@@ -25,9 +25,11 @@ > > import java.io.InputStream; > > import java.io.InputStreamReader; > > import java.net.MalformedURLException; > >+import java.net.SocketPermission; > > import java.net.URL; > > import java.net.URLClassLoader; > > import java.security.AccessControlContext; > >+import java.security.AccessControlException; > > import java.security.AccessController; > > import java.security.AllPermission; > > import java.security.CodeSource; > >@@ -35,9 +37,12 @@ > > import java.security.PermissionCollection; > > import java.security.Permissions; > > import java.security.PrivilegedAction; > >+import java.security.PrivilegedActionException; > > import java.security.PrivilegedExceptionAction; > >+import java.security.ProtectionDomain; > > import java.util.ArrayList; > > import java.util.Arrays; > >+import java.util.Collection; > > import java.util.Collections; > > import java.util.Enumeration; > > import java.util.HashMap; > >@@ -948,6 +953,11 @@ > > result.add(runtimePermissions.get(i)); > > } > > > >+ // Class from host X should be allowed to connect to host X > >+ if (cs.getLocation().getHost().length()> 0) > >+ result.add(new SocketPermission(cs.getLocation().getHost(), > >+ "connect, accept")); > >+ > > return result; > > } catch (RuntimeException ex) { > > if (JNLPRuntime.isDebug()) { > >@@ -1316,10 +1326,21 @@ > > for (int i = 0; i< loaders.length; i++) { > > Class result = null; > > > >- if (loaders[i] == this) > >- result = super.findLoadedClass(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ try { > >+ result = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() { > >+ return JNLPClassLoader.super.findLoadedClass(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ result = null; > >+ } > >+ } else { > > result = loaders[i].findLoadedClassAll(name); > >+ } > > > > if (result != null) > > return result; > >@@ -1517,12 +1538,20 @@ > > protected Class findClass(String name) throws ClassNotFoundException { > > for (int i = 0; i< loaders.length; i++) { > > try { > >- if (loaders[i] == this) > >- return super.findClass(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ return AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() throws ClassNotFoundException { > >+ return JNLPClassLoader.super.findClass(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } else { > > return loaders[i].findClass(name); > >+ } > > } catch (ClassNotFoundException ex) { > > } catch (ClassFormatError cfe) { > >+ } catch (PrivilegedActionException pae) { > > } > > Although unrelated this consumed exception scares me. > > } > > > >@@ -1631,20 +1660,42 @@ > > */ > > private Enumeration findResourcesBySearching(String name) throws IOException { > > List resources = new ArrayList(); > >- Enumeration e; > >+ Enumeration e = null; > > > > for (int i = 0; i< loaders.length; i++) { > > // TODO check if this will blow up or not > > // if loaders[1].getResource() is called, wont it call getResource() on > > // the original caller? infinite recursion? > > > >- if (loaders[i] == this) > >- e = super.findResources(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ try { > >+ e = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Enumeration run() throws IOException { > >+ return JNLPClassLoader.super.findResources(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ } > >+ } else { > > e = loaders[i].findResources(name); > >+ } > > > >- while (e.hasMoreElements()) > >- resources.add(e.nextElement()); > >+ final Enumeration fURLEnum = e; > >+ try { > >+ resources.addAll(AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Collection run() { > >+ List resources = new ArrayList(); > >+ while (fURLEnum != null&& fURLEnum.hasMoreElements()) { > >+ resources.add(fURLEnum.nextElement()); > >+ } > >+ return resources; > >+ } > >+ }, getAccessControlContextForClassLoading())); > >+ } catch (PrivilegedActionException pae) { > >+ } > > } > > > > // Add resources from codebase (only if nothing was found above, > >@@ -1896,6 +1947,56 @@ > > } > > } > > > >+ /** > >+ * Returns an appropriate AccessControlContext for loading classes in > >+ * the running instance. > >+ * > >+ * The default context during class-loading only allows connection to > >+ * codebase. However applets are allowed to load jars from arbitrary > >+ * locations and the codebase only access falls short if a class from > >+ * one location needs a class from another. > >+ * > >+ * Given protected access since CodeBaseClassloader uses this function too. > >+ * > >+ * @return The appropriate AccessControlContext for loading classes for this instance > >+ */ > >+ public AccessControlContext getAccessControlContextForClassLoading() { > >+ AccessControlContext context = AccessController.getContext(); > >+ > >+ try { > >+ context.checkPermission(new AllPermission()); > >+ return context; // If context already has all permissions, don't bother > >+ } catch (AccessControlException ace) { > >+ // continue below > >+ } > >+ > >+ // Since this is for class-loading, technically any class from one jar > >+ // should be able to access a class from another, therefore making the > >+ // original context code source irrelevant > >+ PermissionCollection permissions = this.security.getSandBoxPermissions(); > >+ > >+ // Local cache access permissions > >+ for (Permission resourcePermission : resourcePermissions) { > >+ permissions.add(resourcePermission); > >+ } > >+ > >+ // Permissions for all remote hosting urls > >+ for (URL u: jarLocationSecurityMap.keySet()) { > >+ permissions.add(new SocketPermission(u.getHost(), > >+ "connect, accept")); > >+ } > >+ > >+ // Permissions for codebase urls > >+ for (URL u : codeBaseLoader.getURLs()) { > >+ permissions.add(new SocketPermission(u.getHost(), > >+ "connect, accept")); > >+ } > >+ > >+ ProtectionDomain pd = new ProtectionDomain(null, permissions); > >+ > >+ return new AccessControlContext(new ProtectionDomain[] { pd }); > >+ } > >+ > > /* > > * Helper class to expose protected URLClassLoader methods. > > */ > >@@ -1927,10 +2028,16 @@ > > throw new ClassNotFoundException(name); > > > > try { > >- return super.findClass(name); > >- } catch (ClassNotFoundException cnfe) { > >+ final String fName = name; > >+ return AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() throws ClassNotFoundException { > >+ return CodeBaseClassLoader.super.findClass(fName); > >+ } > >+ }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > > notFoundResources.put(name, super.getURLs()); > >- throw cnfe; > >+ throw new ClassNotFoundException("Could not find class " + name); > > } > > } > > > >@@ -1983,8 +2090,18 @@ > > if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) > > return null; > > > >+ URL url = null; > > if (!name.startsWith("META-INF")) { > >- URL url = super.findResource(name); > >+ try { > >+ final String fName = name; > >+ url = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction() { > >+ public URL run() { > >+ return CodeBaseClassLoader.super.findResource(fName); > >+ } > >+ }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ } > > > > if (url == null) { > > notFoundResources.put(name, super.getURLs()); > > Thanx for patch! > J. From jvanek at redhat.com Tue Jun 5 07:05:03 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 16:05:03 +0200 Subject: [icedtea-web] RFC: Patch for PR861: Code in a jar cannot connect to jar host server In-Reply-To: <20120605135338.GA30821@redhat.com> References: <20120528171606.GP29866@redhat.com> <4FCC9142.8090505@redhat.com> <20120605135338.GA30821@redhat.com> Message-ID: <4FCE120F.6040705@redhat.com> On 06/05/2012 03:53 PM, Deepak Bhole wrote: > * Jiri Vanek [2012-06-04 06:39]: >> On 05/28/2012 07:16 PM, Deepak Bhole wrote: >>> Hi, >>> >>> Attached patch resolves PR861: >>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 >>> >>> ChangeLog: >>> 2012-05-28 Deepak Bhole >>> >>> PR861: Allow loading from non codebase hosts. Allow code to connect to >>> hosting server. >>> * netx/net/sourceforge/jnlp/SecurityDesc.java >>> (getSandBoxPermissions): Only add host if it is not empty. >>> * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> (getPermissions): Add SocketPermission for code source host. >>> (findLoadedClassAll): Call super methods privileged so that connection to >>> non codebase hosts can be made. >>> (findClass): Same. >>> (findResourcesBySearching): Same. Also use privileged context for enum >>> operations because the enum is defined on the fly by URLClassLoader and >>> checks for hosting server connectivity via next(). >>> (getAccessControlContextForClassLoading): New method. Returns a control >>> context for classloader operations like find/load/etc. >>> (CodeBaseClassLoader::findClass): Call super methods privileged so that >>> connection to non codebase hosts can be made. >>> (CodeBaseClassLoader::findResource): Same. >>> >>> Applets may specify jars from different host servers. The current code only >>> allows socket connect permissions for codebase. This is insufficient as a class >> >from one jar may need a class from another jar that is hosted on a different >>> server. >>> >>> Furthermore, if a class comes from server foo, it should be allowed to connect >>> to foo throughout its lifetime. >>> >>> Attached patch resolves the above issues and makes the site mentioned in the >>> bug (http://broadband.mpi-sws.org/transparency/glasnost.php) work again. >>> >>> OK for HEAD? >>> >>> Cheers, >>> Deepak >> >> Hi! >> I have walked across the code and looks ok. >> Two questions inline. >> >> Btw - can you suggest me a bit How I can write an reproducer? >> >> There is ability in current framework to run several wirtual servers on "different urls" by different ports. >> So you can run application from localhost:1234 and downlaod resource from localhsot:56789. Will this be enough for this testing ( I will elaborate on this reproducers) >> > > Hi Jiri, > > Different URLs will not be enough unfortunately. We will need different > DNSs to reproduce this :( ugh. Thats an challenge... > > Is the patch itself OK to push btw? sure > > Cheers, > Deepak > >>> >>> >>> PR861.patch >>> >>> >>> diff -r 6df151bb5320 NEWS >>> --- a/NEWS Fri May 25 11:44:13 2012 -0400 >>> +++ b/NEWS Mon May 28 13:11:12 2012 -0400 >>> @@ -15,6 +15,7 @@ >>> * Plugin >>> - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp >>> - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass >>> + - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server. >>> * Common >>> - PR918: java applet windows uses a low resulution black/white icon >>> >>> diff -r 6df151bb5320 netx/net/sourceforge/jnlp/SecurityDesc.java >>> --- a/netx/net/sourceforge/jnlp/SecurityDesc.java Fri May 25 11:44:13 2012 -0400 >>> +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Mon May 28 13:11:12 2012 -0400 >>> @@ -238,7 +238,7 @@ >>> for (int i = 0; i< jnlpRIAPermissions.length; i++) >>> permissions.add(jnlpRIAPermissions[i]); >>> >>> - if (downloadHost != null) >>> + if (downloadHost != null&& downloadHost.length()> 0) >>> permissions.add(new SocketPermission(downloadHost, >>> "connect, accept")); >> >> You are adding privileges - shouldn't application request for SocketPermission itself? >>> >>> diff -r 6df151bb5320 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java >>> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri May 25 11:44:13 2012 -0400 >>> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon May 28 13:11:12 2012 -0400 >>> @@ -25,9 +25,11 @@ >>> import java.io.InputStream; >>> import java.io.InputStreamReader; >>> import java.net.MalformedURLException; >>> +import java.net.SocketPermission; >>> import java.net.URL; >>> import java.net.URLClassLoader; >>> import java.security.AccessControlContext; >>> +import java.security.AccessControlException; >>> import java.security.AccessController; >>> import java.security.AllPermission; >>> import java.security.CodeSource; >>> @@ -35,9 +37,12 @@ >>> import java.security.PermissionCollection; >>> import java.security.Permissions; >>> import java.security.PrivilegedAction; >>> +import java.security.PrivilegedActionException; >>> import java.security.PrivilegedExceptionAction; >>> +import java.security.ProtectionDomain; >>> import java.util.ArrayList; >>> import java.util.Arrays; >>> +import java.util.Collection; >>> import java.util.Collections; >>> import java.util.Enumeration; >>> import java.util.HashMap; >>> @@ -948,6 +953,11 @@ >>> result.add(runtimePermissions.get(i)); >>> } >>> >>> + // Class from host X should be allowed to connect to host X >>> + if (cs.getLocation().getHost().length()> 0) >>> + result.add(new SocketPermission(cs.getLocation().getHost(), >>> + "connect, accept")); >>> + >>> return result; >>> } catch (RuntimeException ex) { >>> if (JNLPRuntime.isDebug()) { >>> @@ -1316,10 +1326,21 @@ >>> for (int i = 0; i< loaders.length; i++) { >>> Class result = null; >>> >>> - if (loaders[i] == this) >>> - result = super.findLoadedClass(name); >>> - else >>> + if (loaders[i] == this) { >>> + final String fName = name; >>> + try { >>> + result = AccessController.doPrivileged( >>> + new PrivilegedExceptionAction>() { >>> + public Class run() { >>> + return JNLPClassLoader.super.findLoadedClass(fName); >>> + } >>> + }, getAccessControlContextForClassLoading()); >>> + } catch (PrivilegedActionException pae) { >>> + result = null; >>> + } >>> + } else { >>> result = loaders[i].findLoadedClassAll(name); >>> + } >>> >>> if (result != null) >>> return result; >>> @@ -1517,12 +1538,20 @@ >>> protected Class findClass(String name) throws ClassNotFoundException { >>> for (int i = 0; i< loaders.length; i++) { >>> try { >>> - if (loaders[i] == this) >>> - return super.findClass(name); >>> - else >>> + if (loaders[i] == this) { >>> + final String fName = name; >>> + return AccessController.doPrivileged( >>> + new PrivilegedExceptionAction>() { >>> + public Class run() throws ClassNotFoundException { >>> + return JNLPClassLoader.super.findClass(fName); >>> + } >>> + }, getAccessControlContextForClassLoading()); >>> + } else { >>> return loaders[i].findClass(name); >>> + } >>> } catch (ClassNotFoundException ex) { >>> } catch (ClassFormatError cfe) { >>> + } catch (PrivilegedActionException pae) { >>> } >> >> Although unrelated this consumed exception scares me. >>> } >>> >>> @@ -1631,20 +1660,42 @@ >>> */ >>> private Enumeration findResourcesBySearching(String name) throws IOException { >>> List resources = new ArrayList(); >>> - Enumeration e; >>> + Enumeration e = null; >>> >>> for (int i = 0; i< loaders.length; i++) { >>> // TODO check if this will blow up or not >>> // if loaders[1].getResource() is called, wont it call getResource() on >>> // the original caller? infinite recursion? >>> >>> - if (loaders[i] == this) >>> - e = super.findResources(name); >>> - else >>> + if (loaders[i] == this) { >>> + final String fName = name; >>> + try { >>> + e = AccessController.doPrivileged( >>> + new PrivilegedExceptionAction>() { >>> + public Enumeration run() throws IOException { >>> + return JNLPClassLoader.super.findResources(fName); >>> + } >>> + }, getAccessControlContextForClassLoading()); >>> + } catch (PrivilegedActionException pae) { >>> + } >>> + } else { >>> e = loaders[i].findResources(name); >>> + } >>> >>> - while (e.hasMoreElements()) >>> - resources.add(e.nextElement()); >>> + final Enumeration fURLEnum = e; >>> + try { >>> + resources.addAll(AccessController.doPrivileged( >>> + new PrivilegedExceptionAction>() { >>> + public Collection run() { >>> + List resources = new ArrayList(); >>> + while (fURLEnum != null&& fURLEnum.hasMoreElements()) { >>> + resources.add(fURLEnum.nextElement()); >>> + } >>> + return resources; >>> + } >>> + }, getAccessControlContextForClassLoading())); >>> + } catch (PrivilegedActionException pae) { >>> + } >>> } >>> >>> // Add resources from codebase (only if nothing was found above, >>> @@ -1896,6 +1947,56 @@ >>> } >>> } >>> >>> + /** >>> + * Returns an appropriate AccessControlContext for loading classes in >>> + * the running instance. >>> + * >>> + * The default context during class-loading only allows connection to >>> + * codebase. However applets are allowed to load jars from arbitrary >>> + * locations and the codebase only access falls short if a class from >>> + * one location needs a class from another. >>> + * >>> + * Given protected access since CodeBaseClassloader uses this function too. >>> + * >>> + * @return The appropriate AccessControlContext for loading classes for this instance >>> + */ >>> + public AccessControlContext getAccessControlContextForClassLoading() { >>> + AccessControlContext context = AccessController.getContext(); >>> + >>> + try { >>> + context.checkPermission(new AllPermission()); >>> + return context; // If context already has all permissions, don't bother >>> + } catch (AccessControlException ace) { >>> + // continue below >>> + } >>> + >>> + // Since this is for class-loading, technically any class from one jar >>> + // should be able to access a class from another, therefore making the >>> + // original context code source irrelevant >>> + PermissionCollection permissions = this.security.getSandBoxPermissions(); >>> + >>> + // Local cache access permissions >>> + for (Permission resourcePermission : resourcePermissions) { >>> + permissions.add(resourcePermission); >>> + } >>> + >>> + // Permissions for all remote hosting urls >>> + for (URL u: jarLocationSecurityMap.keySet()) { >>> + permissions.add(new SocketPermission(u.getHost(), >>> + "connect, accept")); >>> + } >>> + >>> + // Permissions for codebase urls >>> + for (URL u : codeBaseLoader.getURLs()) { >>> + permissions.add(new SocketPermission(u.getHost(), >>> + "connect, accept")); >>> + } >>> + >>> + ProtectionDomain pd = new ProtectionDomain(null, permissions); >>> + >>> + return new AccessControlContext(new ProtectionDomain[] { pd }); >>> + } >>> + >>> /* >>> * Helper class to expose protected URLClassLoader methods. >>> */ >>> @@ -1927,10 +2028,16 @@ >>> throw new ClassNotFoundException(name); >>> >>> try { >>> - return super.findClass(name); >>> - } catch (ClassNotFoundException cnfe) { >>> + final String fName = name; >>> + return AccessController.doPrivileged( >>> + new PrivilegedExceptionAction>() { >>> + public Class run() throws ClassNotFoundException { >>> + return CodeBaseClassLoader.super.findClass(fName); >>> + } >>> + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); >>> + } catch (PrivilegedActionException pae) { >>> notFoundResources.put(name, super.getURLs()); >>> - throw cnfe; >>> + throw new ClassNotFoundException("Could not find class " + name); >>> } >>> } >>> >>> @@ -1983,8 +2090,18 @@ >>> if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) >>> return null; >>> >>> + URL url = null; >>> if (!name.startsWith("META-INF")) { >>> - URL url = super.findResource(name); >>> + try { >>> + final String fName = name; >>> + url = AccessController.doPrivileged( >>> + new PrivilegedExceptionAction() { >>> + public URL run() { >>> + return CodeBaseClassLoader.super.findResource(fName); >>> + } >>> + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); >>> + } catch (PrivilegedActionException pae) { >>> + } >>> >>> if (url == null) { >>> notFoundResources.put(name, super.getURLs()); >> >> Thanx for patch! >> J. From omajid at redhat.com Tue Jun 5 07:01:22 2012 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Jun 2012 10:01:22 -0400 Subject: [RFC][icedtea-web][rhino] added tests for corner cases of dateRange and enabled testWeekdayRange In-Reply-To: <4FCE054F.9020104@redhat.com> References: <4EB92EFA.9000601@redhat.com> <4EBAB6E4.3030606@redhat.com> <4EBBB198.4080400@redhat.com> <4FBBD166.5010201@redhat.com> <4FBCD173.1020603@redhat.com> <4FC3CD9C.8070109@redhat.com> <4FCE054F.9020104@redhat.com> Message-ID: <4FCE1132.3010107@redhat.com> On 06/05/2012 09:10 AM, Jiri Vanek wrote: > On 05/28/2012 09:10 PM, Omair Majid wrote: >> On 05/23/2012 08:00 AM, Jiri Vanek wrote: >>> On 05/22/2012 07:48 PM, Omair Majid wrote: >>>> On 11/10/2011 06:12 AM, Jiri Vanek wrote: >>>>> Attached is patch with fixed indentation >>>> >>>> Well, turns out that this isn't quite true :( >>>> >>>>> - // note: watch out for wrapping around of dates. date ranges, >>>>> like >>>>> - // month=9 to month=8, wrap around and cover the entire year. >>>>> this >>>>> - // makes everything more interesting >>>>> + function isDateInRange() { >>>> >>>> I completely missed that this makes isDateInRange a top-level function. >>>> I intentionally wanted to avoid this; this script now exposes this >>>> (unexpected) function to all the proxy auto config scripts. I can >>>> imagine all sorts of name clashes if a script accidentally defines a >>>> function with the same name. Can we fix this somehow while still >>>> keeping >>>> the testing benefits? >>> >>> Well javascript private-members is painful theme. Just google around and >>> you will get scared. What just about to rename it? >>> I will need some nasty refactoring and prototyping which have its >>> disadvantages. >>> >>> isDateInRange -> diuaseOUIUHroigjodHPffg484gfjfg ? :) >>> >>> or better >>> isDateInRange -> isDateInRange_internallForIcedTeaWebTesting ? >> >> There are no guarantees that these wont clash either, especially if >> someone is trying to make that happen :( >> >> Still, it's better than what we have now. So go for it! >> >> Omair > here we are Thanks for the patch. Looks fine to me. Perhaps you can even alias isDateInRange to isDateInRange_internallForIcedTeaWebTesting and have fewer changes? Anyway, it's fine as it is if you want to go ahead with it. > 2012-06-05 Jiri Vanek > > * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: and > * tests/netx/pac/pac-funcs-test.js: isDateInRange renamed to > isDateInRange_internallForIcedTeaWebTesting Please list both function names in full. Somethign like this works for me: (isDateInRange): Renamed to isDateInRange_internallForIcedTeaWebTesting. (isDateInRange_internallForIcedTeaWebTesting): New function. You can see some more rename examples at: http://www.opensource.apple.com/source/emacs/emacs-50/emacs/lisp/ChangeLog.8?txt Cheers, Omair From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 07:04:13 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:04:13 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 --- Comment #24 from Deepak Bhole --- Hi All, I was actually able to reproduce the issue this time! (not sure what changed) I think the culprit is the same as #861. I tried the patch I posted for it and everything works again. The patch is still in review but can someone here apply it against head and try it by any chance? http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018789.html Thanks. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/1499cf11/attachment.html From jvanek at icedtea.classpath.org Tue Jun 5 07:11:25 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:11:25 +0000 Subject: /hg/icedtea-web: isDateInRange renamed to isDateInRange_internal... Message-ID: changeset c87cba6608c6 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=c87cba6608c6 author: Jiri Vanek date: Tue Jun 05 16:14:42 2012 +0200 isDateInRange renamed to isDateInRange_internallForIcedTeaWebTesting diffstat: ChangeLog | 8 ++++++++ netx/net/sourceforge/jnlp/runtime/pac-funcs.js | 16 ++++++++-------- tests/netx/pac/pac-funcs-test.js | 14 +++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diffs (82 lines): diff -r a78024e7139f -r c87cba6608c6 ChangeLog --- a/ChangeLog Mon Jun 04 15:10:20 2012 -0400 +++ b/ChangeLog Tue Jun 05 16:14:42 2012 +0200 @@ -1,3 +1,11 @@ +2012-06-05 Jiri Vanek + + isDateInRange renamed to isDateInRange_internallForIcedTeaWebTesting + * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: and + * tests/netx/pac/pac-funcs-test.js: + (isDateInRange): Renamed to isDateInRange_internallForIcedTeaWebTesting. + (isDateInRange_internallForIcedTeaWebTesting): New function + 2012-06-04 Saad Mohammad Added signed jnlp file tests. diff -r a78024e7139f -r c87cba6608c6 netx/net/sourceforge/jnlp/runtime/pac-funcs.js --- a/netx/net/sourceforge/jnlp/runtime/pac-funcs.js Mon Jun 04 15:10:20 2012 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/pac-funcs.js Tue Jun 05 16:14:42 2012 +0200 @@ -326,19 +326,19 @@ */ function dateRange() { switch (arguments.length) { - case 1: return isDateInRange(new Date(),arguments[0]); - case 2: return isDateInRange(new Date(),arguments[0],arguments[1]); - case 3: return isDateInRange(new Date(),arguments[0],arguments[1],arguments[2]); - case 4: return isDateInRange(new Date(),arguments[0],arguments[1],arguments[2],arguments[3]); - case 5: return isDateInRange(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]); - case 6: return isDateInRange(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]); - case 7: return isDateInRange(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]); //GMT + case 1: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0]); + case 2: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1]); + case 3: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2]); + case 4: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3]); + case 5: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]); + case 6: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]); + case 7: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]); //GMT default: return false; } } -function isDateInRange() { +function isDateInRange_internallForIcedTeaWebTesting() { function isDate(date) { if (typeof(date) === 'number' && (date <= 31 && date >= 1)) { diff -r a78024e7139f -r c87cba6608c6 tests/netx/pac/pac-funcs-test.js --- a/tests/netx/pac/pac-funcs-test.js Mon Jun 04 15:10:20 2012 -0400 +++ b/tests/netx/pac/pac-funcs-test.js Tue Jun 05 16:14:42 2012 +0200 @@ -492,13 +492,13 @@ var aYearFromNow = new Date(current.getFullYear()+1, current.getMonth()+1, current.getDate()+1); var later = [aYearFromNow.getDate(), aYearFromNow.getMonth(), aYearFromNow.getFullYear()]; - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, today[0], monthToStr(today[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]), yesterday[2], tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2] ]); - runTest(isDateInRange, [ false, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ false, current, tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2], later[0], monthToStr(later[1]), later[2] ]); } @@ -528,11 +528,11 @@ var yesterday = incDate(current,'day',-1); var today = incDate(current,'day',0); var tomorrow = incDate(current,'day',1); - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , today[0], monthToStr(today[1]) ]); - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); - runTest(isDateInRange, [ true, current, + runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]), yesterday[2], tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2] ]); } } From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 07:12:51 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:12:51 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 --- Comment #25 from Deepak Bhole --- (In reply to comment #24) > Hi All, > > I was actually able to reproduce the issue this time! (not sure what changed) > > I think the culprit is the same as #861. I tried the patch I posted for it > and everything works again. The patch is still in review but can someone > here apply it against head and try it by any chance? > The patch was just approved. So just checking out/building head and testing would suffice. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/3abee459/attachment.html From dbhole at redhat.com Tue Jun 5 07:13:36 2012 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 5 Jun 2012 10:13:36 -0400 Subject: [icedtea-web] RFC: Patch for PR861: Code in a jar cannot connect to jar host server In-Reply-To: <4FCE120F.6040705@redhat.com> References: <20120528171606.GP29866@redhat.com> <4FCC9142.8090505@redhat.com> <20120605135338.GA30821@redhat.com> <4FCE120F.6040705@redhat.com> Message-ID: <20120605141335.GC30821@redhat.com> * Jiri Vanek [2012-06-05 10:01]: > On 06/05/2012 03:53 PM, Deepak Bhole wrote: > >* Jiri Vanek [2012-06-04 06:39]: > >>On 05/28/2012 07:16 PM, Deepak Bhole wrote: > > > >Hi Jiri, > > > >Different URLs will not be enough unfortunately. We will need different > >DNSs to reproduce this :( > > ugh. Thats an challenge... > > > > >Is the patch itself OK to push btw? > > sure > Thanks! Pushed to HEAD. Cheers, Deepak From jvanek at redhat.com Tue Jun 5 07:17:19 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Tue, 05 Jun 2012 16:17:19 +0200 Subject: [rfc][icedtea-web] known to fail annotation In-Reply-To: <4FCE00D0.5070904@redhat.com> References: <4FB11904.1000408@redhat.com> <4FB26531.7010104@redhat.com> <4FB26C97.4030108@redhat.com> <4FB26E05.6060104@redhat.com> <4FB271F6.2050807@redhat.com> <4FBB8D18.5040505@redhat.com> <4FBBCD37.7060806@redhat.com> <4FBCFB37.5000109@redhat.com> <4FCD124F.90701@redhat.com> <4FCE00D0.5070904@redhat.com> Message-ID: <4FCE14EF.1030903@redhat.com> On 06/05/2012 02:51 PM, Jiri Vanek wrote: > On 06/04/2012 09:53 PM, Omair Majid wrote: >> On 05/23/2012 10:59 AM, Jiri Vanek wrote: >>> On 05/22/2012 07:30 PM, Omair Majid wrote: >>>> On 05/22/2012 08:56 AM, Jiri Vanek wrote: >>>>> As agreed on IRC, Percentage removed. What do you think now? > ...snip .. >>> diff -r 1088b2dffe49 tests/junit-runner/LessVerboseTextListener.java >>> --- a/tests/junit-runner/LessVerboseTextListener.java Tue May 22 12:08:17 2012 +0200 >>> +++ b/tests/junit-runner/LessVerboseTextListener.java Wed May 23 16:41:21 2012 +0200 >> >>> @@ -45,7 +60,56 @@ >>> int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); >>> int failed = result.getFailureCount(); >>> int ignored = result.getIgnoreCount(); >>> - writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); >>> + writer.println("Test known to fail ("+totalK2F+"): passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); >>> + writer.println("Test results ("+result.getRunCount()+"): passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); >>> + } > > > Do you mind to have total/totalKnownToFail line here? So the three lines will be > > total > know to fail sumary > unchanged last line as you wanted > > =~ > > writer.println("Total tests "+result.getRunCount()+"/ known to fail tests "+totalK2F); > writer.println("Test known to fail: passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); > writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); > >> >> Please leave the original line ("Test results: passed:"..) unchanged >> (unless you are going to combine the two lines). >> >> Otherwise, this looks fine to me. > Is this approve? :D >> >> Cheers, >> Omair > example of output: .... Passed: net.sourceforge.jnlp.ParserMalformedXml.testMissingXmlDecleration FAILED: testMalformedArguments(net.sourceforge.jnlp.ParserMalformedXml) Invalid XML document syntax. - This test is known to fail FAILED: testTagNotClosed(net.sourceforge.jnlp.ParserMalformedXml) Invalid XML document syntax. - This test is known to fail FAILED: testUnquotedAttributes(net.sourceforge.jnlp.ParserMalformedXml) Invalid XML document syntax. - This test is known to fail Passed: net.sourceforge.jnlp.util.PropertiesFileTest.testReloadAfterStore Passed: net.sourceforge.jnlp.util.ImageResourcesTest.testApplicationImages Passed: net.sourceforge.jnlp.util.replacements.BASE64EncoderTest.testEmbededBase64Encoder Passed: net.sourceforge.jnlp.util.replacements.BASE64EncoderTest.testEmbededBase64EncoderAgainstSunOne Total tests run: 75; From those : 8 known to fail Test known to fail: passed: 0; failed: 8; ignored: 0 Test results: passed: 66; failed: 9; ignored: 0 (do not bother with the one-more failing test) 2012-05-14 Jiri Vanek * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java New file. Annotation for marking failing tests. * tests/report-styles/jreport.xsl: * tests/junit-runner/LessVerboseTextListener.java: * tests/junit-runner/JunitLikeXmlOutputListener.java: Added counting and printing of @KnownToFail annotations if presented. * tests/jnlp_tests/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java: (SpacesCanBeEverywhereRemoteTests1) (SpacesCanBeEverywhereRemoteTests2) (SpacesCanBeEverywhereRemoteTests3) * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: (testTemplateCDATA) (testApplicationCDATA) * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java: (testCDataFirstChild) (testCDataSecondChild) (testCommentInAttributes) * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: (testMalformedArguments) (testTagNotClosed) (testUnquotedAttributes) marked as KnownToFail -------------- next part -------------- A non-text attachment was scrubbed... Name: knownToFail-final.diff Type: text/x-patch Size: 26945 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/2db6a4cc/knownToFail-final.diff From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 07:14:26 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:14:26 +0000 Subject: [Bug 843] www.mojebanka.cz hangs with icedtea-web In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=843 --- Comment #26 from Jaroslav Reznik --- Thank Deepak, I'm going to try a build with patch and I'll let you know. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/fafce44e/attachment.html From omajid at redhat.com Tue Jun 5 07:17:01 2012 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Jun 2012 10:17:01 -0400 Subject: [rfc][icedtea-web] known to fail annotation In-Reply-To: <4FCE14EF.1030903@redhat.com> References: <4FB11904.1000408@redhat.com> <4FB26531.7010104@redhat.com> <4FB26C97.4030108@redhat.com> <4FB26E05.6060104@redhat.com> <4FB271F6.2050807@redhat.com> <4FBB8D18.5040505@redhat.com> <4FBBCD37.7060806@redhat.com> <4FBCFB37.5000109@redhat.com> <4FCD124F.90701@redhat.com> <4FCE00D0.5070904@redhat.com> <4FCE14EF.1030903@redhat.com> Message-ID: <4FCE14DD.9020304@redhat.com> On 06/05/2012 10:17 AM, Jiri Vanek wrote: > On 06/05/2012 02:51 PM, Jiri Vanek wrote: >> On 06/04/2012 09:53 PM, Omair Majid wrote: >>> On 05/23/2012 10:59 AM, Jiri Vanek wrote: >>>> On 05/22/2012 07:30 PM, Omair Majid wrote: >>>>> On 05/22/2012 08:56 AM, Jiri Vanek wrote: >>>>>> As agreed on IRC, Percentage removed. What do you think now? >> ...snip .. >>>> diff -r 1088b2dffe49 tests/junit-runner/LessVerboseTextListener.java >>>> --- a/tests/junit-runner/LessVerboseTextListener.java Tue May 22 >>>> 12:08:17 2012 +0200 >>>> +++ b/tests/junit-runner/LessVerboseTextListener.java Wed May 23 >>>> 16:41:21 2012 +0200 >>> >>>> @@ -45,7 +60,56 @@ >>>> int passed = result.getRunCount() - result.getFailureCount() - >>>> result.getIgnoreCount(); >>>> int failed = result.getFailureCount(); >>>> int ignored = result.getIgnoreCount(); >>>> - writer.println("Test results: passed: " + passed + "; failed: " + >>>> failed + "; ignored: " + ignored); >>>> + writer.println("Test known to fail ("+totalK2F+"): passed: " + >>>> passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); >>>> + writer.println("Test results ("+result.getRunCount()+"): passed: " >>>> + passed + "; failed: " + failed + "; ignored: " + ignored); >>>> + } >> >> >> Do you mind to have total/totalKnownToFail line here? So the three >> lines will be >> >> total >> know to fail sumary >> unchanged last line as you wanted >> >> =~ >> >> writer.println("Total tests "+result.getRunCount()+"/ known to fail >> tests "+totalK2F); >> writer.println("Test known to fail: passed: " + passedK2F + "; failed: >> " + failedK2F + "; ignored: " + ignoredK2F); >> writer.println("Test results: passed: " + passed + "; failed: " + >> failed + "; ignored: " + ignored); >> Looks fine to me. But please check that buildbots on icedtea.classpath.org can parse (or post a patch to fix them too). Cheers, Omair From omajid at redhat.com Tue Jun 5 07:17:33 2012 From: omajid at redhat.com (Omair Majid) Date: Tue, 05 Jun 2012 10:17:33 -0400 Subject: [rfc][icedtea-web] known to fail annotation In-Reply-To: <4FCE00D0.5070904@redhat.com> References: <4FB11904.1000408@redhat.com> <4FB26531.7010104@redhat.com> <4FB26C97.4030108@redhat.com> <4FB26E05.6060104@redhat.com> <4FB271F6.2050807@redhat.com> <4FBB8D18.5040505@redhat.com> <4FBBCD37.7060806@redhat.com> <4FBCFB37.5000109@redhat.com> <4FCD124F.90701@redhat.com> <4FCE00D0.5070904@redhat.com> Message-ID: <4FCE14FD.30206@redhat.com> On 06/05/2012 08:51 AM, Jiri Vanek wrote: > On 06/04/2012 09:53 PM, Omair Majid wrote: >> Otherwise, this looks fine to me. > Is this approve? :D Hahaha. Yes :) Cheers, Omair From jvanek at icedtea.classpath.org Tue Jun 5 07:32:21 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:32:21 +0000 Subject: /hg/icedtea-web: Added KnownToFail annotation Message-ID: changeset 30d29b2698f3 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=30d29b2698f3 author: Jiri Vanek date: Tue Jun 05 16:35:50 2012 +0200 Added KnownToFail annotation diffstat: ChangeLog | 19 + tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java | 2 + tests/junit-runner/JunitLikeXmlOutputListener.java | 170 +++++++-- tests/junit-runner/LessVerboseTextListener.java | 66 +++ tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java | 24 + tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java | 3 + tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java | 4 + tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java | 4 + tests/report-styles/jreport.xsl | 62 +++- 9 files changed, 305 insertions(+), 49 deletions(-) diffs (truncated from 704 to 500 lines): diff -r c87cba6608c6 -r 30d29b2698f3 ChangeLog --- a/ChangeLog Tue Jun 05 16:14:42 2012 +0200 +++ b/ChangeLog Tue Jun 05 16:35:50 2012 +0200 @@ -1,3 +1,22 @@ +2012-05-14 Jiri Vanek + + * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java + New file. Annotation for marking failing tests. + * tests/report-styles/jreport.xsl: + * tests/junit-runner/LessVerboseTextListener.java: + * tests/junit-runner/JunitLikeXmlOutputListener.java: Added counting + and printing of @KnownToFail annotations if presented. + * tests/jnlp_tests/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java: + (SpacesCanBeEverywhereRemoteTests1) (SpacesCanBeEverywhereRemoteTests2) + (SpacesCanBeEverywhereRemoteTests3) + * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: (testTemplateCDATA) + (testApplicationCDATA) + * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java: + (testCDataFirstChild) (testCDataSecondChild) (testCommentInAttributes) + * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: + (testMalformedArguments) (testTagNotClosed) (testUnquotedAttributes) + marked as KnownToFail + 2012-06-05 Jiri Vanek isDateInRange renamed to isDateInRange_internallForIcedTeaWebTesting diff -r c87cba6608c6 -r 30d29b2698f3 tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java --- a/tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java Tue Jun 05 16:14:42 2012 +0200 +++ b/tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java Tue Jun 05 16:35:50 2012 +0200 @@ -48,6 +48,7 @@ import java.util.regex.Pattern; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.ProcessResult; +import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.AfterClass; import org.junit.Assert; @@ -108,6 +109,7 @@ }; @Test + @KnownToFail public void startParallelInstancesUponBrokenCache() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); diff -r c87cba6608c6 -r 30d29b2698f3 tests/junit-runner/JunitLikeXmlOutputListener.java --- a/tests/junit-runner/JunitLikeXmlOutputListener.java Tue Jun 05 16:14:42 2012 +0200 +++ b/tests/junit-runner/JunitLikeXmlOutputListener.java Tue Jun 05 16:35:50 2012 +0200 @@ -20,7 +20,9 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.TimeUnit; import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.internal.JUnitSystem; @@ -28,6 +30,7 @@ import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; + /** * This class listens for events in junit testsuite and wrote output to xml. * Xml tryes to follow ant-tests schema, and is enriched for by-class statistics @@ -45,6 +48,7 @@ private static final String TEST_ELEMENT = "testcase"; private static final String BUGS = "bugs"; private static final String BUG = "bug"; + private static final String K2F = "known-to-fail"; private static final String TEST_NAME_ATTRIBUTE = "name"; private static final String TEST_TIME_ATTRIBUTE = "time"; private static final String TEST_ERROR_ELEMENT = "error"; @@ -65,15 +69,24 @@ private static final String SUMMARY_IGNORED_ELEMENT = "ignored"; private long testStart; - private class ClassCounter { + private int failedK2F=0; + private int passedK2F=0; + private int ignoredK2F=0; + + private class ClassStat { Class c; int total; int failed; int passed; + int ignored; long time = 0; + int totalK2F=0; + int failedK2F=0; + int passedK2F=0; + int ignoredK2F=0; } - Map classStats = new HashMap(); + Map classStats = new HashMap(); public JunitLikeXmlOutputListener(JUnitSystem system, File f) { try { @@ -99,9 +112,11 @@ attString.append(" "); Set> entries = atts.entrySet(); for (Entry entry : entries) { - String k=entry.getKey(); - String v= entry.getValue(); - if (v==null)v="null"; + String k = entry.getKey(); + String v = entry.getValue(); + if (v == null) { + v = "null"; + } attString.append(k).append("=\"").append(attributize(v)).append("\""); attString.append(" "); } @@ -137,7 +152,7 @@ @Override public void testStarted(Description description) throws Exception { testFailed = null; - testStart = System.nanoTime() / 1000l / 1000l; + testStart = System.nanoTime(); } @Override @@ -146,20 +161,54 @@ } @Override + public void testIgnored(Description description) throws Exception { + testDone(description, 0, 0, true); + } + + @Override public void testFinished(org.junit.runner.Description description) throws Exception { - long testTime = System.nanoTime()/1000l/1000l - testStart; + long testTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - testStart); double testTimeSeconds = ((double) testTime) / 1000d; + testDone(description, testTime, testTimeSeconds, false); + } - Map testcaseAtts = new HashMap(3); + private void testDone(Description description, long testTime, double testTimeSeconds, boolean ignored) throws Exception { + Class testClass = null; + Method testMethod = null; + try { + testClass = description.getTestClass(); + String qs = description.getMethodName(); + //handling @Browser'bugsIds marking of used browser + if (qs.contains(" - ")) { + qs = qs.replaceAll(" - .*", ""); + } + testMethod = testClass.getMethod(qs); + } catch (Exception ex) { + ex.printStackTrace(); + } + Map testcaseAtts = new HashMap(4); NumberFormat formatter = new DecimalFormat("#0.0000"); String stringedTime = formatter.format(testTimeSeconds); stringedTime.replace(",", "."); testcaseAtts.put(TEST_TIME_ATTRIBUTE, stringedTime); testcaseAtts.put(TEST_CLASS_ATTRIBUTE, description.getClassName()); testcaseAtts.put(TEST_NAME_ATTRIBUTE, description.getMethodName()); - + KnownToFail k2f=null; + try { + if (testClass != null && testMethod != null) { + k2f = testMethod.getAnnotation(KnownToFail.class); + if (k2f != null) { + testcaseAtts.put(K2F, Boolean.TRUE.toString()); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } openElement(TEST_ELEMENT, testcaseAtts); if (testFailed != null) { + if (k2f != null) { + failedK2F++; + } Map errorAtts = new HashMap(3); errorAtts.put(ERROR_MESSAGE_ATTRIBUTE, testFailed.getMessage()); @@ -171,25 +220,32 @@ } writeElement(TEST_ERROR_ELEMENT, testFailed.getTrace(), errorAtts); + } else { + if (k2f != null) { + if (ignored) { + ignoredK2F++; + } else { + passedK2F++; + + } + } } try { - Class q = description.getTestClass(); - String qs=description.getMethodName(); - if (qs.contains(" - ")) qs=qs.replaceAll(" - .*", ""); - Method qm = q.getMethod(qs); - Bug b = qm.getAnnotation(Bug.class); - if (b != null) { - openElement(BUGS); - String[] s = b.id(); - for (String string : s) { - String ss[]=createBug(string); - Map visibleNameAtt=new HashMap(1); - visibleNameAtt.put("visibleName", ss[0]); - openElement(BUG,visibleNameAtt); - writer.write(ss[1]); + if (testClass != null && testMethod != null) { + Bug bug = testMethod.getAnnotation(Bug.class); + if (bug != null) { + openElement(BUGS); + String[] bugsIds = bug.id(); + for (String bugId : bugsIds) { + String idAndUrl[] = createBug(bugId); + Map visibleNameAtt = new HashMap(1); + visibleNameAtt.put("visibleName", idAndUrl[0]); + openElement(BUG, visibleNameAtt); + writer.write(idAndUrl[1]); closeElement(BUG); + } + closeElement(BUGS); } - closeElement(BUGS); } } catch (Exception ex) { ex.printStackTrace(); @@ -197,19 +253,34 @@ closeElement(TEST_ELEMENT); writer.flush(); - ClassCounter cc = classStats.get(description.getClassName()); - if (cc == null) { - cc = new ClassCounter(); - cc.c=description.getTestClass(); - classStats.put(description.getClassName(), cc); + ClassStat classStat = classStats.get(description.getClassName()); + if (classStat == null) { + classStat = new ClassStat(); + classStat.c = description.getTestClass(); + classStats.put(description.getClassName(), classStat); } - cc.total++; - cc.time += testTime; + classStat.total++; + if (k2f != null) { + classStat.totalK2F++; + } + classStat.time += testTime; if (testFailed == null) { - cc.passed++; + if (ignored) { + classStat.ignored++; + if (k2f != null) { + classStat.ignoredK2F++; + } + } else { + classStat.passed++; + if (k2f != null) { + classStat.passedK2F++; + } + } } else { - - cc.failed++; + classStat.failed++; + if (k2f != null) { + classStat.failedK2F++; + } } } @@ -223,24 +294,24 @@ int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); int failed = result.getFailureCount(); int ignored = result.getIgnoreCount(); - writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(result.getRunCount())); - writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(failed)); - writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(ignored)); - writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(passed)); + writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(result.getRunCount()),createKnownToFailSumamryAttribute(failedK2F+passedK2F+ignoredK2F)); + writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(failed),createKnownToFailSumamryAttribute(failedK2F)); + writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(ignored),createKnownToFailSumamryAttribute(ignoredK2F)); + writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(passed),createKnownToFailSumamryAttribute(passedK2F)); closeElement(SUMMARY_ELEMENT); openElement(CLASSES_ELEMENT); - Set> e = classStats.entrySet(); - for (Entry entry : e) { + Set> e = classStats.entrySet(); + for (Entry entry : e) { Map testcaseAtts = new HashMap(3); testcaseAtts.put(TEST_NAME_ATTRIBUTE, entry.getKey()); testcaseAtts.put(TEST_TIME_ATTRIBUTE, String.valueOf(entry.getValue().time)); openElement(TEST_CLASS_ELEMENT, testcaseAtts); - writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(entry.getValue().passed)); - writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(entry.getValue().failed)); - writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(entry.getValue().total - entry.getValue().failed - entry.getValue().passed)); - writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(entry.getValue().total)); + writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(entry.getValue().passed),createKnownToFailSumamryAttribute(entry.getValue().passedK2F)); + writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(entry.getValue().failed),createKnownToFailSumamryAttribute(entry.getValue().failedK2F)); + writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(entry.getValue().ignored),createKnownToFailSumamryAttribute(entry.getValue().ignoredK2F)); + writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(entry.getValue().total),createKnownToFailSumamryAttribute(entry.getValue().totalK2F)); try { Bug b = null; if (entry.getValue().c != null) { @@ -250,10 +321,10 @@ openElement(BUGS); String[] s = b.id(); for (String string : s) { - String ss[]=createBug(string); - Map visibleNameAtt=new HashMap(1); + String ss[] = createBug(string); + Map visibleNameAtt = new HashMap(1); visibleNameAtt.put("visibleName", ss[0]); - openElement(BUG,visibleNameAtt); + openElement(BUG, visibleNameAtt); writer.write(ss[1]); closeElement(BUG); } @@ -273,6 +344,11 @@ } + public Map createKnownToFailSumamryAttribute(int count) { + Map atts = new HashMap(1); + atts.put(K2F, String.valueOf(count)); + return atts; + } /** * When declare for suite class or for Test-marked method, diff -r c87cba6608c6 -r 30d29b2698f3 tests/junit-runner/LessVerboseTextListener.java --- a/tests/junit-runner/LessVerboseTextListener.java Tue Jun 05 16:14:42 2012 +0200 +++ b/tests/junit-runner/LessVerboseTextListener.java Tue Jun 05 16:35:50 2012 +0200 @@ -6,6 +6,8 @@ * http://www.eclipse.org/legal/cpl-v10.html */ import java.io.PrintStream; +import java.lang.reflect.Method; +import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.internal.JUnitSystem; import org.junit.runner.Description; @@ -17,6 +19,10 @@ private PrintStream writer; private boolean testFailed = false; + private int totalK2F=0; + private int failedK2F=0; + private int passedK2F=0; + private int ignoredK2F=0; public LessVerboseTextListener(JUnitSystem system) { writer= system.out(); @@ -28,15 +34,24 @@ } @Override + public void testIgnored(Description description) throws Exception { + writer.println("Ignored: " + description.getClassName() + "." + description.getMethodName()); + printK2F(writer, null, description); + } + + + @Override public void testFailure(Failure failure) { testFailed = true; writer.println("FAILED: " + failure.getTestHeader() + " " + failure.getMessage()); + printK2F(writer,true,failure.getDescription()); } @Override public void testFinished(org.junit.runner.Description description) throws Exception { if (!testFailed) { writer.println("Passed: " + description.getClassName() + "." + description.getMethodName()); + printK2F(writer,false,description); } } @@ -45,7 +60,58 @@ int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); int failed = result.getFailureCount(); int ignored = result.getIgnoreCount(); + writer.println("Total tests run: "+result.getRunCount()+"; From those : " + totalK2F + " known to fail"); + writer.println("Test known to fail: passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); + + } + + private void printK2F(PrintStream writer, Boolean failed, Description description) { + try { + KnownToFail k2f = getK2F(description); + if (k2f != null) { + totalK2F++; + if (failed != null) { + if (failed) { + failedK2F++; + } else { + passedK2F++; + } + } else { + ignoredK2F++; + } + if (failed != null && !failed) { + writer.println(" - WARNING This test is known to fail, but have passed!"); + } else { + writer.println(" - This test is known to fail"); + } + } + + + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public static KnownToFail getK2F(Description description) { + try { + Class q = description.getTestClass(); + if (q != null) { + String qs = description.getMethodName(); + if (qs.contains(" - ")) { + qs = qs.replaceAll(" - .*", ""); + } + Method qm = q.getMethod(qs); + if (qm != null) { + KnownToFail k2f = qm.getAnnotation(KnownToFail.class); + return k2f; + + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + return null; } } diff -r c87cba6608c6 -r 30d29b2698f3 tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java Tue Jun 05 16:35:50 2012 +0200 @@ -0,0 +1,24 @@ +package net.sourceforge.jnlp.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

+ * This annotation marks a test as a known failure (as opposed to a + * regression). A test that is a known failure will not hold of a release, + * nor should developers hold off a fix if they run the unit tests and a + * test marked as a known failure fails. + *

+ * This annotation is meant for adding tests for bugs before the fix is + * implemented. + *

+ */ + + at Target({ElementType.METHOD,ElementType.TYPE}) + at Retention(RetentionPolicy.RUNTIME) +public @interface KnownToFail { + +} diff -r c87cba6608c6 -r 30d29b2698f3 tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java --- a/tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java Tue Jun 05 16:14:42 2012 +0200 +++ b/tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java Tue Jun 05 16:35:50 2012 +0200 @@ -42,6 +42,7 @@ import java.io.InputStreamReader; import java.io.StringReader; import java.util.Random; +import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; @@ -79,6 +80,7 @@ } @Test + @KnownToFail public void testTemplateCDATA() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); @@ -240,6 +242,7 @@ } @Test + @KnownToFail public void testApplicationCDATA() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); diff -r c87cba6608c6 -r 30d29b2698f3 tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java From jvanek at icedtea.classpath.org Tue Jun 5 07:35:54 2012 From: jvanek at icedtea.classpath.org (jvanek at icedtea.classpath.org) Date: Tue, 05 Jun 2012 14:35:54 +0000 Subject: /hg/icedtea-web: fixed date in changelog Message-ID: changeset 67c462561ee3 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=67c462561ee3 author: Jiri Vanek date: Tue Jun 05 16:39:27 2012 +0200 fixed date in changelog diffstat: ChangeLog | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (9 lines): diff -r 30d29b2698f3 -r 67c462561ee3 ChangeLog --- a/ChangeLog Tue Jun 05 16:35:50 2012 +0200 +++ b/ChangeLog Tue Jun 05 16:39:27 2012 +0200 @@ -1,4 +1,4 @@ -2012-05-14 Jiri Vanek +2012-06-05 Jiri Vanek * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java New file. Annotation for marking failing tests. From dbhole at icedtea.classpath.org Tue Jun 5 08:00:13 2012 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Tue, 05 Jun 2012 15:00:13 +0000 Subject: /hg/icedtea-web: PR861: Allow loading from non codebase hosts. A... Message-ID: changeset 954131311826 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=954131311826 author: Deepak Bhole date: Tue Jun 05 10:11:09 2012 -0400 PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server diffstat: ChangeLog | 20 ++ NEWS | 1 + netx/net/sourceforge/jnlp/SecurityDesc.java | 2 +- netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 149 +++++++++++++++- 4 files changed, 155 insertions(+), 17 deletions(-) diffs (285 lines): diff -r 67c462561ee3 -r 954131311826 ChangeLog --- a/ChangeLog Tue Jun 05 16:39:27 2012 +0200 +++ b/ChangeLog Tue Jun 05 10:11:09 2012 -0400 @@ -1,3 +1,23 @@ +2012-06-05 Deepak Bhole + + PR861: Allow loading from non codebase hosts. Allow code to connect to + hosting server. + * netx/net/sourceforge/jnlp/SecurityDesc.java + (getSandBoxPermissions): Only add host if it is not empty. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getPermissions): Add SocketPermission for code source host. + (findLoadedClassAll): Call super methods privileged so that connection to + non codebase hosts can be made. + (findClass): Same. + (findResourcesBySearching): Same. Also use privileged context for enum + operations because the enum is defined on the fly by URLClassLoader and + checks for hosting server connectivity via next(). + (getAccessControlContextForClassLoading): New method. Returns a control + context for classloader operations like find/load/etc. + (CodeBaseClassLoader::findClass): Call super methods privileged so that + connection to non codebase hosts can be made. + (CodeBaseClassLoader::findResource): Same. + 2012-06-05 Jiri Vanek * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java diff -r 67c462561ee3 -r 954131311826 NEWS --- a/NEWS Tue Jun 05 16:39:27 2012 +0200 +++ b/NEWS Tue Jun 05 10:11:09 2012 -0400 @@ -16,6 +16,7 @@ - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp - PR863: Error passing strings to applet methods in Chromium - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass + - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server * Common - PR918: java applet windows uses a low resulution black/white icon diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/SecurityDesc.java --- a/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 16:39:27 2012 +0200 +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 10:11:09 2012 -0400 @@ -238,7 +238,7 @@ for (int i = 0; i < jnlpRIAPermissions.length; i++) permissions.add(jnlpRIAPermissions[i]); - if (downloadHost != null) + if (downloadHost != null && downloadHost.length() > 0) permissions.add(new SocketPermission(downloadHost, "connect, accept")); diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 16:39:27 2012 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 10:11:09 2012 -0400 @@ -25,9 +25,11 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; +import java.net.SocketPermission; import java.net.URL; import java.net.URLClassLoader; import java.security.AccessControlContext; +import java.security.AccessControlException; import java.security.AccessController; import java.security.AllPermission; import java.security.CodeSource; @@ -35,9 +37,12 @@ import java.security.PermissionCollection; import java.security.Permissions; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; @@ -952,6 +957,11 @@ result.add(runtimePermissions.get(i)); } + // Class from host X should be allowed to connect to host X + if (cs.getLocation().getHost().length() > 0) + result.add(new SocketPermission(cs.getLocation().getHost(), + "connect, accept")); + return result; } catch (RuntimeException ex) { if (JNLPRuntime.isDebug()) { @@ -1320,10 +1330,21 @@ for (int i = 0; i < loaders.length; i++) { Class result = null; - if (loaders[i] == this) - result = super.findLoadedClass(name); - else + if (loaders[i] == this) { + final String fName = name; + try { + result = AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Class run() { + return JNLPClassLoader.super.findLoadedClass(fName); + } + }, getAccessControlContextForClassLoading()); + } catch (PrivilegedActionException pae) { + result = null; + } + } else { result = loaders[i].findLoadedClassAll(name); + } if (result != null) return result; @@ -1521,12 +1542,20 @@ protected Class findClass(String name) throws ClassNotFoundException { for (int i = 0; i < loaders.length; i++) { try { - if (loaders[i] == this) - return super.findClass(name); - else + if (loaders[i] == this) { + final String fName = name; + return AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Class run() throws ClassNotFoundException { + return JNLPClassLoader.super.findClass(fName); + } + }, getAccessControlContextForClassLoading()); + } else { return loaders[i].findClass(name); + } } catch (ClassNotFoundException ex) { } catch (ClassFormatError cfe) { + } catch (PrivilegedActionException pae) { } } @@ -1635,20 +1664,42 @@ */ private Enumeration findResourcesBySearching(String name) throws IOException { List resources = new ArrayList(); - Enumeration e; + Enumeration e = null; for (int i = 0; i < loaders.length; i++) { // TODO check if this will blow up or not // if loaders[1].getResource() is called, wont it call getResource() on // the original caller? infinite recursion? - if (loaders[i] == this) - e = super.findResources(name); - else + if (loaders[i] == this) { + final String fName = name; + try { + e = AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Enumeration run() throws IOException { + return JNLPClassLoader.super.findResources(fName); + } + }, getAccessControlContextForClassLoading()); + } catch (PrivilegedActionException pae) { + } + } else { e = loaders[i].findResources(name); + } - while (e.hasMoreElements()) - resources.add(e.nextElement()); + final Enumeration fURLEnum = e; + try { + resources.addAll(AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Collection run() { + List resources = new ArrayList(); + while (fURLEnum != null && fURLEnum.hasMoreElements()) { + resources.add(fURLEnum.nextElement()); + } + return resources; + } + }, getAccessControlContextForClassLoading())); + } catch (PrivilegedActionException pae) { + } } // Add resources from codebase (only if nothing was found above, @@ -1900,6 +1951,56 @@ } } + /** + * Returns an appropriate AccessControlContext for loading classes in + * the running instance. + * + * The default context during class-loading only allows connection to + * codebase. However applets are allowed to load jars from arbitrary + * locations and the codebase only access falls short if a class from + * one location needs a class from another. + * + * Given protected access since CodeBaseClassloader uses this function too. + * + * @return The appropriate AccessControlContext for loading classes for this instance + */ + public AccessControlContext getAccessControlContextForClassLoading() { + AccessControlContext context = AccessController.getContext(); + + try { + context.checkPermission(new AllPermission()); + return context; // If context already has all permissions, don't bother + } catch (AccessControlException ace) { + // continue below + } + + // Since this is for class-loading, technically any class from one jar + // should be able to access a class from another, therefore making the + // original context code source irrelevant + PermissionCollection permissions = this.security.getSandBoxPermissions(); + + // Local cache access permissions + for (Permission resourcePermission : resourcePermissions) { + permissions.add(resourcePermission); + } + + // Permissions for all remote hosting urls + for (URL u: jarLocationSecurityMap.keySet()) { + permissions.add(new SocketPermission(u.getHost(), + "connect, accept")); + } + + // Permissions for codebase urls + for (URL u : codeBaseLoader.getURLs()) { + permissions.add(new SocketPermission(u.getHost(), + "connect, accept")); + } + + ProtectionDomain pd = new ProtectionDomain(null, permissions); + + return new AccessControlContext(new ProtectionDomain[] { pd }); + } + /* * Helper class to expose protected URLClassLoader methods. */ @@ -1931,10 +2032,16 @@ throw new ClassNotFoundException(name); try { - return super.findClass(name); - } catch (ClassNotFoundException cnfe) { + final String fName = name; + return AccessController.doPrivileged( + new PrivilegedExceptionAction>() { + public Class run() throws ClassNotFoundException { + return CodeBaseClassLoader.super.findClass(fName); + } + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); + } catch (PrivilegedActionException pae) { notFoundResources.put(name, super.getURLs()); - throw cnfe; + throw new ClassNotFoundException("Could not find class " + name); } } @@ -1987,8 +2094,18 @@ if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) return null; + URL url = null; if (!name.startsWith("META-INF")) { - URL url = super.findResource(name); + try { + final String fName = name; + url = AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public URL run() { + return CodeBaseClassLoader.super.findResource(fName); + } + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); + } catch (PrivilegedActionException pae) { + } if (url == null) { notFoundResources.put(name, super.getURLs()); From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 08:00:22 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 15:00:22 +0000 Subject: [Bug 861] Code in a jar cannot connect to jar host server In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 --- Comment #3 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=954131311826 author: Deepak Bhole date: Tue Jun 05 10:11:09 2012 -0400 PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/50b7f4c4/attachment.html From bugzilla-daemon at icedtea.classpath.org Tue Jun 5 08:08:26 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 05 Jun 2012 15:08:26 +0000 Subject: [Bug 825] OpenOffice crash on opening file (attached) In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=825 --- Comment #7 from Winfried Huber --- Since LibreOffice runs without these problems for months (both vendor (openSuSE) supplied versions 3.4.x as well as the current versions 3.5.x) this issue seems to vanish behind the fog wall of history. It seems not to be clear if this was a java problem or a native LibreOffice problem. So I would suggest to close this one. Thanks to all that helped in investigation and improvement - LibreOffice really is a great tool! May please anyone close this one? It is not clear to me which additional status info to "RESOLVED" is appropriate ... can't find "VANISHED" or "HAS GONE AWAY" or something like that - and "WONTFIX", "WORKSFORME", "NOTABUG" or "NOTOURBUG" IMHO doesn't hit the nail perfectly :-( -- You are receiving this mail because: You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/d7a3c1ff/attachment.html From smohammad at redhat.com Tue Jun 5 08:11:50 2012 From: smohammad at redhat.com (Saad Mohammad) Date: Tue, 05 Jun 2012 11:11:50 -0400 Subject: [RFC][icedtea-web]: Configure browser paths In-Reply-To: <4FCD032D.4040806@redhat.com> References: <4FCCF312.2020504@redhat.com> <4FCD032D.4040806@redhat.com> Message-ID: <4FCE21B6.2030806@redhat.com> Hi, I have attached the patch with all the suggested changes. A few notes below: On 06/04/2012 02:49 PM, Omair Majid wrote: > On 06/04/2012 01:40 PM, Saad Mohammad wrote: >> The patch attached allows the user to configure browser paths and/or >> disable browsers from being used in IcedTea-Web. > > I like this idea. Some comments on the implementaiton details in-line below. > >> --- a/ChangeLog >> +++ b/ChangeLog >> @@ -1,3 +1,11 @@ >> +2012-06-04 Saad Mohammad >> + >> + Allows the user to configure browser paths and/or disable browsers. >> + * acinclude.m4 (IT_FIND_BROWSER): Checks if the browser is set be disabled, or >> + if the path provided is valid. Otherwise, it locates the default path to the browser >> + if found on the system. >> + * configure.ac: Uses IT_FIND_BROWSER to find/configure browsers >> + >> 2012-06-04 Adam Domurad >> >> Added self to AUTHORS. >> diff --git a/acinclude.m4 b/acinclude.m4 >> --- a/acinclude.m4 >> +++ b/acinclude.m4 >> @@ -880,3 +880,29 @@ >> AC_MSG_RESULT([${FULL_VERSION}]) >> AC_SUBST([FULL_VERSION]) >> ]) >> + >> +dnl REQUIRED Parameters: >> +dnl [browser name, variable to store path, default terminal command to run browser (if installed)] > > Would it be possible to make the last argument optional? So if the > caller leaves out the terminal command, default to the browser name? > Yes, implemented this. >> +AC_DEFUN([IT_FIND_BROWSER], >> +[ >> + AC_MSG_CHECKING([for $1]) >> + AC_ARG_WITH([$1], >> + [AS_HELP_STRING(--with-$1,specify the location of $1 or use 'no' as value to disable browser)], > > I think just "specify the location of $1" should be enough. "", "no" and > "yes" are common values that we should accept anyway. > >> + [ >> + if test "${withval}" = "no" ; then >> + $2="" > > Please extends to handle "" (--with-firefox) and "yes" > (--with-firefox=yes) too. > Yes, it now handles "" and "yes". >> + elif test -a "${withval}" ; then > > "-a" is AND. Perhaps you meant '-n "${withval}"' ? But even better would > be "-e" to ensure that ${withval} exists. > Thank you for the suggestion. I am now using "-f" to check whether the file exists (and not a directory). >> + $2=${withval} > > Please be careful with quoting. If the value of withval includes a > space, this will break. > >> + else >> + AC_MSG_FAILURE([invalid location specified to $1: ${withval}]) >> + fi >> + ], > > Does this message make sense in the context it's printed? > > "checking for firefox... " (output from AC_MSG_FAILURE) > > Maybe just a "not found"? > >> + [ >> + $2=$(which $3 2> /dev/null) > > This is probably not the best thing to do. "which" is not a posix > standard command, so some machines/shells may not have it at all. It > also breaks with aliases: > > $ alias firefox='firefox --sync' > $ FIREFOX="$(which firefox 2>/dev/null)" > $ echo $FIREFOX > alias firefox='firefox --sync' /usr/bin/firefox > >> + ]) >> + if test -a "${$2}"; then > > Another "-a" here. > > Omair Thanks for the review Omair. -- Cheers, Saad Mohammad -------------- next part -------------- A non-text attachment was scrubbed... Name: configureBrowser06.patch Type: text/x-patch Size: 2670 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120605/fd57343a/configureBrowser06.patch From ptisnovs at icedtea.classpath.org Wed Jun 6 03:06:23 2012 From: ptisnovs at icedtea.classpath.org (ptisnovs at icedtea.classpath.org) Date: Wed, 06 Jun 2012 10:06:23 +0000 Subject: /hg/gfx-test: * src/org/gfxtest/testsuites/PrintTestCircles.java: Message-ID: changeset 1c4af4ceea8d in /hg/gfx-test details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=1c4af4ceea8d author: Pavel Tisnovsky date: Wed Jun 06 12:09:01 2012 +0200 * src/org/gfxtest/testsuites/PrintTestCircles.java: Added ten new tests to this test suite. diffstat: ChangeLog | 5 + src/org/gfxtest/testsuites/PrintTestCircles.java | 503 +++++++++++++++++++++- 2 files changed, 485 insertions(+), 23 deletions(-) diffs (truncated from 681 to 500 lines): diff -r fae3942e5a44 -r 1c4af4ceea8d ChangeLog --- a/ChangeLog Fri Jun 01 16:22:21 2012 +0200 +++ b/ChangeLog Wed Jun 06 12:09:01 2012 +0200 @@ -1,3 +1,8 @@ +2012-06-06 Pavel Tisnovsky + + * src/org/gfxtest/testsuites/PrintTestCircles.java: + Added ten new tests to this test suite. + 2012-06-01 Pavel Tisnovsky * src/org/gfxtest/testsuites/PrintTestLines.java: diff -r fae3942e5a44 -r 1c4af4ceea8d src/org/gfxtest/testsuites/PrintTestCircles.java --- a/src/org/gfxtest/testsuites/PrintTestCircles.java Fri Jun 01 16:22:21 2012 +0200 +++ b/src/org/gfxtest/testsuites/PrintTestCircles.java Wed Jun 06 12:09:01 2012 +0200 @@ -76,6 +76,10 @@ public class PrintTestCircles extends PrintTest { + private static final float MIN_STROKE_WIDTH = 0.0f; + private static final float WIDTH_DELTA = 0.5f; + protected static final int MAX_COLOR_INDEX = 1000; + /** * Method which renders set of circles using various colors and * stroke styles. For each circle, the callback function/method is called to @@ -183,6 +187,36 @@ /** * Test basic behavior of method Graphics.drawOval(). + * Circles color are selected from a palette. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleColorPaletteInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP, new CommonCircleDrawCallbacks() + { + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + // set circle color + this.graphics.setColor(ColorPalette.getColor(MAX_COLOR_INDEX - index)); + return; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). * Circles color are selected from a grayscale palette. * * @param image @@ -260,7 +294,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -278,7 +312,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -302,7 +336,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -320,7 +354,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -344,7 +378,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -362,7 +396,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -386,7 +420,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -404,7 +438,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -428,7 +462,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -446,7 +480,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -470,7 +504,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -488,7 +522,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -512,7 +546,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -530,7 +564,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -554,7 +588,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -572,7 +606,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -596,7 +630,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -614,7 +648,7 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; } }); @@ -638,7 +672,7 @@ { drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() { - private float strokeWidth = 0.0f; + private float strokeWidth = MIN_STROKE_WIDTH; /** * Callback function called before each circle is rendered. @@ -656,7 +690,430 @@ */ private void changeStrokeWidth() { - this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + 0.5f : this.strokeWidth; + this.strokeWidth = this.strokeWidth < MAX_STROKE_WIDTH ? this.strokeWidth + WIDTH_DELTA : this.strokeWidth; + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_BUTT. + * Join style is set to bevel style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapButtJoinBevelInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)); + changeStrokeWidth(); + return; + } + + /** + * Changes stroke width. + */ + private void changeStrokeWidth() + { + this.strokeWidth -= WIDTH_DELTA; + // stroke width should not be less than zero + if (this.strokeWidth < MIN_STROKE_WIDTH) + { + this.strokeWidth = MIN_STROKE_WIDTH; + } + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_ROUND. + * Join style is set to bevel style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapRoundJoinBevelInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL)); + changeStrokeWidth(); + return; + } + + /** + * Changes stroke width. + */ + private void changeStrokeWidth() + { + this.strokeWidth -= WIDTH_DELTA; + // stroke width should not be less than zero + if (this.strokeWidth < MIN_STROKE_WIDTH) + { + this.strokeWidth = MIN_STROKE_WIDTH; + } + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_SQUARE. + * Join style is set to bevel style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapSquareJoinBevelInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL)); + changeStrokeWidth(); + return; + } + + /** + * Changes stroke width. + */ + private void changeStrokeWidth() + { + this.strokeWidth -= WIDTH_DELTA; + // stroke width should not be less than zero + if (this.strokeWidth < MIN_STROKE_WIDTH) + { + this.strokeWidth = MIN_STROKE_WIDTH; + } + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_BUTT. + * Join style is set to miter style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapButtJoinMiterInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); + changeStrokeWidth(); + return; + } + + /** + * Changes stroke width. + */ + private void changeStrokeWidth() + { + this.strokeWidth -= WIDTH_DELTA; + // stroke width should not be less than zero + if (this.strokeWidth < MIN_STROKE_WIDTH) + { + this.strokeWidth = MIN_STROKE_WIDTH; + } + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_ROUND. + * Join style is set to miter style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapRoundJoinMiterInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + + /** + * Callback function called before each circle is rendered. + */ + @Override + public void iterationCallBack(int x, int y, int radius, int maxRadius, int index) + { + this.graphics.setStroke(new BasicStroke(this.strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)); + changeStrokeWidth(); + return; + } + + /** + * Changes stroke width. + */ + private void changeStrokeWidth() + { + this.strokeWidth -= WIDTH_DELTA; + // stroke width should not be less than zero + if (this.strokeWidth < MIN_STROKE_WIDTH) + { + this.strokeWidth = MIN_STROKE_WIDTH; + } + } + }); + + // test return value + return TestResult.PASSED; + } + + /** + * Test basic behavior of method Graphics.drawOval(). + * Circles are rendered with various width and end caps set to CAP_SQUARE. + * Join style is set to miter style. + * Color of all rendered circles are set to black. + * + * @param image + * image to which circles are to be drawn + * @param graphics2d + * graphics canvas + * @return test result status - PASSED, FAILED or ERROR + */ + public TestResult testDrawCircleChangeWidthCapSquareJoinMiterInv(TestImage image, Graphics2D graphics2d) + { + drawCircle(image, graphics2d, CIRCLE_RADIUS_STEP << 1, new CommonCircleDrawCallbacks() + { + private float strokeWidth = MAX_STROKE_WIDTH - 2; + From ahughes at redhat.com Wed Jun 6 06:11:25 2012 From: ahughes at redhat.com (Andrew Hughes) Date: Wed, 06 Jun 2012 09:11:25 -0400 (EDT) Subject: purging openJDK from Ubuntu In-Reply-To: Message-ID: ----- Original Message ----- > Hi, > > I'm trying to purge openJDK from my system in Ubuntu Precise with > apt-get, > but it forces me to install a different version of OpenJDK every time > I > try to do so, so for example when I try apt-get purge openjdk-7-jre, > it > forces me to install openjdk 6 and vice versa. I've got a custom > update-alternatives setup and this bug breaks dpkg every time I > upgrade, > so any help is greatly appreciated. > > -- > Bayan Rafeh > Why would you want to do this? -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From ahughes at redhat.com Wed Jun 6 06:15:34 2012 From: ahughes at redhat.com (Andrew Hughes) Date: Wed, 06 Jun 2012 09:15:34 -0400 (EDT) Subject: Backporting Patches In-Reply-To: <31aaee74-c82e-4764-bdb0-46639fd8675d@zmail17.collab.prod.int.phx2.redhat.com> Message-ID: Please be careful when backporting patches from 8/7 to 6 and note any changes you need to make clearly in the ChangeLog. Silent changes seem to have been made to a backport of 6610244 in IcedTea6, which caused build breakage when that patch was then applied upstream: -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From ahughes at redhat.com Wed Jun 6 06:16:32 2012 From: ahughes at redhat.com (Andrew Hughes) Date: Wed, 06 Jun 2012 09:16:32 -0400 (EDT) Subject: Backporting Patches In-Reply-To: Message-ID: <242c0e14-6674-4796-b853-129e61c8e79f@zmail17.collab.prod.int.phx2.redhat.com> Please be careful when backporting patches from 8/7 to 6 and note any changes you need to make clearly in the ChangeLog. Silent changes seem to have been made to a backport of 6610244 in IcedTea6, which caused build breakage when that patch was then applied upstream: http://mail.openjdk.java.net/pipermail/jdk6-dev/2012-June/002693.html Thanks, -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07 From ChPhilli at redhat.com Wed Jun 6 06:19:27 2012 From: ChPhilli at redhat.com (Chris Phillips) Date: Wed, 06 Jun 2012 09:19:27 -0400 Subject: RFC: Patch to enable adapter_opt_spread jsr 292 adapter code in zero In-Reply-To: <4FCCA6EE.2030509@RedHat.Com> References: <4FCCA6EE.2030509@RedHat.Com> Message-ID: <4FCF58DF.7090409@redhat.com> Hi Attached is an update to this patch with further fixes. And the summary from current 64 bit testing is attached below below. (I will build and run the sametest on arm later this am) On 04/06/12 08:15 AM, Chris Phillips wrote: > Hi > This patch provides support for jsr 292 in zero. > It is against : > http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot > but will eventually apply to upstream also, ( after fixing other > issues to > allow testing). It enables a portion of jsr 292 logic that was not > functional > in the c++ Interpreter. It passes a large portion of the internal > dynamic invoke test suite (test/java/lang/invoke) although there are > still > 4 failing tests and 10 "NYI" (mostly involving Ricochet frames). > > It has been vetted once in a slightly altered form internally but I would > appreciate a few more eyes, would like to apply so qa testing can > continue later today. > > Chris > > Attached is an update to this patch with further fixes. And the summary from current 64 bit testing is attached below below. (I will build and run the same test on arm later this am, also will provide patches and Makefile changes for testing with zero shortly.) Chris -- -- -- Woda: "Java: write once, debug anywhere" Hong Zhang http://thehenrys.ca | Chris Phillips @ T.O. Red Hat OpenJDK JVM Engineer, | | mailto:ChrisPhi at RedHat.Com (416)483-3768 | | http://LGonQn.Org/www/Chris.Phillips cell: (416)505-3610 | "EPIC stands for Expects Perfectly Intuitive Compilers" P. Bannon http://www.hazmatmodine.com NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. "blah blah blah - Ginger!" -- -- -------------- next part -------------- # HG changeset patch # User chrisphi # Date 1338987885 14400 # Node ID 8ee78476051b9d220666a541243e8f5872ca5469 # Parent d1154290751107fc148173d73bc0cdef145f2230 Enable _adapter_opt_spread* jsr 292 code, now passes all but 13 tests in John Rose test suite, 10 of those are NYI. Should fix issues seen in arm qa testing. diff --git a/src/cpu/zero/vm/cppInterpreter_zero.cpp b/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -36,6 +36,7 @@ #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" +#include "prims/methodHandles.hpp" #include "runtime/arguments.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" @@ -65,6 +66,14 @@ CALL_VM_NOCHECK_NOFIX(func) \ fixup_after_potential_safepoint() + +#ifdef DEBUG +#define CPPINT_DEBUG( Z_code_ ) Z_code_ +CPPINT_DEBUG ( static const char *FFng_Zero_Flag = "CPPINT_DEBUG_ON\n"; ) +#else +#define CPPINT_DEBUG( Z_code_ ) +#endif + int CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; @@ -699,6 +708,9 @@ method_handle = adapter; } + CPPINT_DEBUG( tty->print_cr( "Process method_handle sp: 0x%x unwind_sp: 0x%x result_slots: %d.", \ + stack->sp(), unwind_sp, result_slots ); ) + // Start processing process_method_handle(method_handle, THREAD); if (HAS_PENDING_EXCEPTION) @@ -718,6 +730,8 @@ } // Check + CPPINT_DEBUG( tty->print_cr( "Exiting method_handle_entry, sp: 0x%x unwind_sp: 0x%x result_slots: %d.", \ + stack->sp(), unwind_sp, result_slots ); ) assert(stack->sp() == unwind_sp - result_slots, "should be"); // No deoptimized frames on the stack @@ -725,6 +739,7 @@ } void CppInterpreter::process_method_handle(oop method_handle, TRAPS) { + JavaThread *thread = (JavaThread *) THREAD; ZeroStack *stack = thread->zero_stack(); intptr_t *vmslots = stack->sp(); @@ -739,6 +754,7 @@ (MethodHandles::EntryKind) (((intptr_t) entry) & 0xffffffff); methodOop method = NULL; + CPPINT_DEBUG( tty->print_cr( "\nEntering %s 0x%x.",MethodHandles::entry_name(entry_kind), (char *)vmslots ); ) switch (entry_kind) { case MethodHandles::_invokestatic_mh: direct_to_method = true; @@ -1080,12 +1096,309 @@ } break; - default: - tty->print_cr("unhandled entry_kind %s", + case MethodHandles::_adapter_opt_spread_0: + case MethodHandles::_adapter_opt_spread_1_ref: + case MethodHandles::_adapter_opt_spread_2_ref: + case MethodHandles::_adapter_opt_spread_3_ref: + case MethodHandles::_adapter_opt_spread_4_ref: + case MethodHandles::_adapter_opt_spread_5_ref: + case MethodHandles::_adapter_opt_spread_ref: + case MethodHandles::_adapter_opt_spread_byte: + case MethodHandles::_adapter_opt_spread_char: + case MethodHandles::_adapter_opt_spread_short: + case MethodHandles::_adapter_opt_spread_int: + case MethodHandles::_adapter_opt_spread_long: + case MethodHandles::_adapter_opt_spread_float: + case MethodHandles::_adapter_opt_spread_double: + { + + // spread an array out into a group of arguments + + int arg_slot = + java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); + // Fetch the argument, which we will cast to the required array type. + oop arg = VMSLOTS_OBJECT(arg_slot); + + BasicType elem_type = + MethodHandles::ek_adapter_opt_spread_type(entry_kind); + int elem_slots = + type2size[elem_type]; // 1 or 2 + int array_slots = + 1; // array is always a T_OBJECT + int length_offset = + arrayOopDesc::length_offset_in_bytes(); + int elem0_offset = + arrayOopDesc::base_offset_in_bytes(elem_type); + int length_constant = + MethodHandles::ek_adapter_opt_spread_count(entry_kind); + int array_length = 0; + void *array_elem0 = NULL; + + CPPINT_DEBUG( tty->print_cr( \ + "ENTERING _adapter_opt_spread: %s %d %d 0x%x 0x%x", \ + type2name(elem_type), arg_slot, length_constant, (char *)arg, stack->sp() ); ) + + // If the spread count is -1, the length is "variable" ie controlled + // by the array length. + // See ek_adapter_opt_spread_count in methodHandles.hpp + // If array lenth is 0 or spread count is 0 , we will remove the argslot. + + bool length_can_be_zero = (length_constant == 0); + if (length_constant < 0) { + // some adapters with variable length must handle the zero case + if (!OptimizeMethodHandles || + elem_type != T_OBJECT) + length_can_be_zero = true; + } + + if (arg == NULL) { + CPPINT_DEBUG( tty->print_cr( \ + "arg NULL implies Array_length == 0, remove slot." ); ) + // remove arg slot + remove_vmslots(arg_slot, 1, THREAD); // doesn't trap + vmslots = stack->sp(); // unused, but let the compiler figure that out + CPPINT_DEBUG( tty->print_cr( \ + " >> Would LEAVE _adapter_opt_spread with NPE." ); ) +#ifdef _NOT_DEF_ + // queue a nullpointer exception for the caller + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_NullPointerException())); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; +#endif + } else { // (arg != NULL) + klassOop objKlassOop = arg->klass(); + klassOop klassOf = java_lang_Class::as_klassOop( + java_lang_invoke_AdapterMethodHandle::argument(method_handle)); + + if (objKlassOop != klassOf && + !objKlassOop->klass_part()->is_subtype_of(klassOf)) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #1 in _adapter_opt_spread." ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + // Check the array type. + + klassOop array_klass_oop = NULL; + BasicType array_type = java_lang_Class::as_BasicType( + java_lang_invoke_AdapterMethodHandle::argument(method_handle), + &array_klass_oop); + arrayKlassHandle array_klass(THREAD, array_klass_oop); + + assert(array_type == T_OBJECT, ""); + assert(Klass::cast(array_klass_oop)->oop_is_array(), ""); + if (!(array_type == T_OBJECT) || + !(Klass::cast(array_klass_oop)->oop_is_array())) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #2 not an array in _adapter_opt_spread." ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + klassOop element_klass_oop = NULL; + BasicType element_type = + java_lang_Class::as_BasicType(array_klass->component_mirror(), + &element_klass_oop); + KlassHandle element_klass(THREAD, element_klass_oop); + if ((elem_type != T_OBJECT) && (elem_type != element_type)) { + CPPINT_DEBUG( tty->print_cr( \ + "CLASS CAST ERROR #3 invalid type %s != %s in _adapter_opt_spread.", \ + type2name(elem_type), type2name(element_type) ); ) + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ClassCastException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + + array_length = arrayOop(arg)->length(); + + // Check the required length. + if (length_constant > 0) { // must match ? + if ( array_length != length_constant ) { + CPPINT_DEBUG( tty->print_cr( \ + "ARRY INDEX ERROR #4 invalid array length in _adapter_opt_spread." ); ) + //fixme ArrayIndexOutOfBoundsException ? + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + // use array_length ? + } else { // length_constant == [ -1 or 0 ] + if ( (array_length > 0) || length_can_be_zero ) { + // use array_length. + } else { // array_length 0 and not length_can_be_zero + CPPINT_DEBUG( tty->print_cr( \ + "ARRY INDEX ERROR #5 arry length 0 in _adapter_opt_spread." ); ) + //fixme ArrayIndexOutOfBoundsException ? + ResourceMark rm(THREAD); + const char* objName = Klass::cast(objKlassOop)->external_name(); + const char* klassName = Klass::cast(klassOf)->external_name(); + char* message = SharedRuntime::generate_class_cast_message( + objName, klassName); + + stack->set_sp(calculate_unwind_sp(stack, method_handle)); + CALL_VM_NOCHECK_NOFIX( + throw_exception( + thread, + vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)); + // NB all oops trashed! + assert(HAS_PENDING_EXCEPTION, "should do"); + return; + } + } + + // Array length checked out. Now insert any required arg slots. + // array_length - 1 more slots if array_length > 0 + // otherwise if array_length == 0 remove arg_slot. + + if ( array_length > 0 ) { + int slots = (array_length * elem_slots) - 1; + CPPINT_DEBUG( tty->print_cr( \ + "array_length %d %d slots needed in _adapter_opt_spread.",\ + array_length, slots); ) + debug_only(if (elem_slots == 2) \ + assert ((slots % 2 == 1)," bad slots calc")); + if ( slots > 0 ) { + intptr_t *unwind_sp = + calculate_unwind_sp(stack, method_handle); + insert_vmslots(arg_slot, slots, THREAD); + if (HAS_PENDING_EXCEPTION) { + // all oops trashed + stack->set_sp(unwind_sp); + return; + } + } + vmslots = stack->sp(); + arg_slot += slots; + + array_elem0 = arrayOop(arg)->base(elem_type); + + // Copy from the array to the new arg slots. + // [from native : Beware: Arguments that are shallow + // on the stack are deep in the array, + // and vice versa. So a downward-growing stack (the usual) + // has to be copied elementwise in reverse order + // from the source array.] + + void * array_elem = array_elem0; + int top_slot = arg_slot; + + debug_only(if (elem_slots == 2) \ + assert ((((ulong)(char *)&vmslots[top_slot]) % \ + (u_int)type2aelembytes(elem_type) == 0), \ + " bad arg alignment")); + + CPPINT_DEBUG( tty->print_cr( \ + "BEGIN ARRY LOOP %d %d 0x%x 0x%x _adapter_opt_spread.",\ + array_length, top_slot, &vmslots[top_slot], array_elem ); ) + + for (int index = 0; index < array_length; index++) { + switch (elem_type) { + case T_BYTE: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_CHAR: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_SHORT: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_INT: + SET_VMSLOTS_INT(*(jint*)array_elem, top_slot); + break; + case T_FLOAT: + SET_VMSLOTS_FLOAT(*(jfloat*)array_elem,top_slot); + break; + case T_LONG: + SET_VMSLOTS_LONG(*(jlong*)array_elem, top_slot); + break; + case T_DOUBLE: + SET_VMSLOTS_DOUBLE(*(jdouble*)array_elem, top_slot); + break; + case T_OBJECT: + SET_VMSLOTS_OBJECT(*(oopDesc**)array_elem, top_slot); + break; + default: + tty->print_cr("unhandled type %s", type2name(elem_type)); + ShouldNotReachHere(); + } + array_elem = (void*)((char *)array_elem + + type2aelembytes(element_type)); + top_slot -= elem_slots; + } + arg_slot++; + } + } + if ((array_length == 0) && (arg != NULL)) { + CPPINT_DEBUG( tty->print_cr( \ + "Array_length == 0, will remove slot." ); ) + // remove arg slot + remove_vmslots(arg_slot, 1, THREAD); // doesn't trap + // unused, but let the compiler figure that out + vmslots = stack->sp(); + // + } + CPPINT_DEBUG( tty->print_cr( \ + "LEAVING _adapter_opt_spread: %s 0x%x 0x%x \n", \ + type2name(elem_type), (char *)arg, (char *)stack->sp() ); ) + } + break; + default: + tty->print_cr("unhandled entry_kind %s", MethodHandles::entry_name(entry_kind)); - ShouldNotReachHere(); + ShouldNotReachHere(); } + // Continue along the chain if (direct_to_method) { if (method == NULL) { @@ -1138,6 +1451,7 @@ tty->print_cr("dst_rtype = %s", type2name(dst_rtype)); ShouldNotReachHere(); } + CPPINT_DEBUG( tty->print_cr( "LEAVING %s\n",MethodHandles::entry_name(entry_kind) ); ) } // The new slots will be inserted before slot insert_before. diff --git a/src/cpu/zero/vm/methodHandles_zero.cpp b/src/cpu/zero/vm/methodHandles_zero.cpp --- a/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/src/cpu/zero/vm/methodHandles_zero.cpp @@ -38,9 +38,8 @@ |(1<(AdapterMethodHandle.java:568) at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556) at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95) at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:588) at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:583) at test.java.lang.invoke.JavaDocExamplesTest.testMethodHandlesSummary(JavaDocExamplesTest.java:241) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 6) testAsSpreader(test.java.lang.invoke.JavaDocExamplesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889) at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.(AdapterMethodHandle.java:568) at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556) at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95) at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:588) at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:583) at sun.invoke.util.ValueConversions$LazyStatics.(ValueConversions.java:694) at sun.invoke.util.ValueConversions.buildArrayProducer(ValueConversions.java:1176) at sun.invoke.util.ValueConversions.varargsArray(ValueConversions.java:1164) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:888) at test.java.lang.invoke.JavaDocExamplesTest.testAsSpreader(JavaDocExamplesTest.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 7) testAsCollector(test.java.lang.invoke.JavaDocExamplesTest) java.lang.NoClassDefFoundError: Could not initialize class sun.invoke.util.ValueConversions$LazyStatics at sun.invoke.util.ValueConversions.buildArrayProducer(ValueConversions.java:1176) at sun.invoke.util.ValueConversions.varargsArray(ValueConversions.java:1164) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:888) at test.java.lang.invoke.JavaDocExamplesTest.testAsCollector(JavaDocExamplesTest.java:318) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 8) testAsVarargsCollector(test.java.lang.invoke.JavaDocExamplesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889) at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.(AdapterMethodHandle.java:568) at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556) at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95) at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:588) at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:583) at test.java.lang.invoke.JavaDocExamplesTest.testAsVarargsCollector(JavaDocExamplesTest.java:349) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 9) testAsFixedArity(test.java.lang.invoke.JavaDocExamplesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:842) at java.lang.invoke.MethodHandleImpl.collectArguments(MethodHandleImpl.java:820) at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:889) at java.lang.invoke.AdapterMethodHandle$AsVarargsCollector.(AdapterMethodHandle.java:568) at java.lang.invoke.AdapterMethodHandle.makeVarargsCollector(AdapterMethodHandle.java:556) at java.lang.invoke.MethodHandleImpl.findMethod(MethodHandleImpl.java:95) at java.lang.invoke.MethodHandles$Lookup.accessStatic(MethodHandles.java:588) at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:583) at test.java.lang.invoke.JavaDocExamplesTest.testAsFixedArity(JavaDocExamplesTest.java:368) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 10) testAsTypeCornerCases(test.java.lang.invoke.JavaDocExamplesTest) java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Integer at java.lang.invoke.FromGeneric$A1.invoke_L1(FromGeneric.java:519) at java.lang.invoke.ToGeneric$A1.target(ToGeneric.java:639) at java.lang.invoke.ToGeneric$A1.targetA1(ToGeneric.java:640) at java.lang.invoke.ToGeneric$A1.invoke_L(ToGeneric.java:643) at java.lang.invoke.FilterGeneric$F2.invoke_V1(FilterGeneric.java:537) at java.lang.invoke.ToGeneric$A1.target(ToGeneric.java:639) at java.lang.invoke.ToGeneric$A1.targetA1(ToGeneric.java:641) at java.lang.invoke.ToGeneric$A1.invoke_I(ToGeneric.java:649) at java.lang.invoke.FromGeneric$A4.invoke_I4(FromGeneric.java:556) at java.lang.invoke.FilterGeneric$F3.invoke_F2(FilterGeneric.java:577) at java.lang.invoke.FilterGeneric$F4.invoke_V3(FilterGeneric.java:608) at java.lang.invoke.ToGeneric$A3.target(ToGeneric.java:699) at java.lang.invoke.ToGeneric$A3.targetA3(ToGeneric.java:701) at java.lang.invoke.ToGeneric$A3.invoke_I(ToGeneric.java:713) at test.java.lang.invoke.JavaDocExamplesTest.testAsTypeCornerCases(JavaDocExamplesTest.java:423) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 11) testFilterReturnValue(test.java.lang.invoke.MethodHandlesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.foldArguments(MethodHandleImpl.java:900) at java.lang.invoke.MethodHandles.foldArguments(MethodHandles.java:2105) at java.lang.invoke.MethodHandles.filterReturnValue(MethodHandles.java:2005) at test.java.lang.invoke.MethodHandlesTest.testFilterReturnValue(MethodHandlesTest.java:1658) at test.java.lang.invoke.MethodHandlesTest.testFilterReturnValue(MethodHandlesTest.java:1641) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 12) testFilterArguments(test.java.lang.invoke.MethodHandlesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:737) at java.lang.invoke.MethodHandle.asType(MethodHandle.java:693) at java.lang.invoke.MethodHandleImpl.filterArgument(MethodHandleImpl.java:877) at java.lang.invoke.MethodHandles.filterArgument(MethodHandles.java:1924) at java.lang.invoke.MethodHandles.filterArguments(MethodHandles.java:1910) at test.java.lang.invoke.MethodHandlesTest.testFilterArguments(MethodHandlesTest.java:1695) at test.java.lang.invoke.MethodHandlesTest.testFilterArguments(MethodHandlesTest.java:1682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) 13) testFoldArguments(test.java.lang.invoke.MethodHandlesTest) java.lang.InternalError: NYI at java.lang.invoke.AdapterMethodHandle.makeReturnConversion(AdapterMethodHandle.java:252) at java.lang.invoke.AdapterMethodHandle.makePairwiseConvert(AdapterMethodHandle.java:208) at java.lang.invoke.MethodHandleImpl.convertArguments(MethodHandleImpl.java:760) at java.lang.invoke.MethodHandleImpl.foldArguments(MethodHandleImpl.java:900) at java.lang.invoke.MethodHandles.foldArguments(MethodHandles.java:2105) at test.java.lang.invoke.MethodHandlesTest.testFoldArguments(MethodHandlesTest.java:1729) at test.java.lang.invoke.MethodHandlesTest.testFoldArguments(MethodHandlesTest.java:1715) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:24) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at org.junit.runner.JUnitCore.run(JUnitCore.java:136) at org.junit.runner.JUnitCore.run(JUnitCore.java:117) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53) at org.junit.runner.JUnitCore.main(JUnitCore.java:45) FAILURES!!! Tests run: 55, Failures: 13 make: *** [unittest] Error 1 From jvanek at redhat.com Wed Jun 6 06:22:56 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Wed, 06 Jun 2012 15:22:56 +0200 Subject: /hg/icedtea-web: PR861: Allow loading from non codebase hosts. A... In-Reply-To: References: Message-ID: <4FCF59B0.6040104@redhat.com> Hi! This patch have broken most of javaws reproducers. I'm suggesting to revert it until it is discovered why. Blame is on my head. Sorry. J. On 06/05/2012 05:00 PM, dbhole at icedtea.classpath.org wrote: > changeset 954131311826 in /hg/icedtea-web > details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=954131311826 > author: Deepak Bhole > date: Tue Jun 05 10:11:09 2012 -0400 > > PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server > > > diffstat: > > ChangeLog | 20 ++ > NEWS | 1 + > netx/net/sourceforge/jnlp/SecurityDesc.java | 2 +- > netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 149 +++++++++++++++- > 4 files changed, 155 insertions(+), 17 deletions(-) > > diffs (285 lines): > > diff -r 67c462561ee3 -r 954131311826 ChangeLog > --- a/ChangeLog Tue Jun 05 16:39:27 2012 +0200 > +++ b/ChangeLog Tue Jun 05 10:11:09 2012 -0400 > @@ -1,3 +1,23 @@ > +2012-06-05 Deepak Bhole > + > + PR861: Allow loading from non codebase hosts. Allow code to connect to > + hosting server. > + * netx/net/sourceforge/jnlp/SecurityDesc.java > + (getSandBoxPermissions): Only add host if it is not empty. > + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > + (getPermissions): Add SocketPermission for code source host. > + (findLoadedClassAll): Call super methods privileged so that connection to > + non codebase hosts can be made. > + (findClass): Same. > + (findResourcesBySearching): Same. Also use privileged context for enum > + operations because the enum is defined on the fly by URLClassLoader and > + checks for hosting server connectivity via next(). > + (getAccessControlContextForClassLoading): New method. Returns a control > + context for classloader operations like find/load/etc. > + (CodeBaseClassLoader::findClass): Call super methods privileged so that > + connection to non codebase hosts can be made. > + (CodeBaseClassLoader::findResource): Same. > + > 2012-06-05 Jiri Vanek > > * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java > diff -r 67c462561ee3 -r 954131311826 NEWS > --- a/NEWS Tue Jun 05 16:39:27 2012 +0200 > +++ b/NEWS Tue Jun 05 10:11:09 2012 -0400 > @@ -16,6 +16,7 @@ > - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp > - PR863: Error passing strings to applet methods in Chromium > - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass > + - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server > * Common > - PR918: java applet windows uses a low resulution black/white icon > > diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/SecurityDesc.java > --- a/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 16:39:27 2012 +0200 > +++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 10:11:09 2012 -0400 > @@ -238,7 +238,7 @@ > for (int i = 0; i< jnlpRIAPermissions.length; i++) > permissions.add(jnlpRIAPermissions[i]); > > - if (downloadHost != null) > + if (downloadHost != null&& downloadHost.length()> 0) > permissions.add(new SocketPermission(downloadHost, > "connect, accept")); > > diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 16:39:27 2012 +0200 > +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 10:11:09 2012 -0400 > @@ -25,9 +25,11 @@ > import java.io.InputStream; > import java.io.InputStreamReader; > import java.net.MalformedURLException; > +import java.net.SocketPermission; > import java.net.URL; > import java.net.URLClassLoader; > import java.security.AccessControlContext; > +import java.security.AccessControlException; > import java.security.AccessController; > import java.security.AllPermission; > import java.security.CodeSource; > @@ -35,9 +37,12 @@ > import java.security.PermissionCollection; > import java.security.Permissions; > import java.security.PrivilegedAction; > +import java.security.PrivilegedActionException; > import java.security.PrivilegedExceptionAction; > +import java.security.ProtectionDomain; > import java.util.ArrayList; > import java.util.Arrays; > +import java.util.Collection; > import java.util.Collections; > import java.util.Enumeration; > import java.util.HashMap; > @@ -952,6 +957,11 @@ > result.add(runtimePermissions.get(i)); > } > > + // Class from host X should be allowed to connect to host X > + if (cs.getLocation().getHost().length()> 0) > + result.add(new SocketPermission(cs.getLocation().getHost(), > + "connect, accept")); > + > return result; > } catch (RuntimeException ex) { > if (JNLPRuntime.isDebug()) { > @@ -1320,10 +1330,21 @@ > for (int i = 0; i< loaders.length; i++) { > Class result = null; > > - if (loaders[i] == this) > - result = super.findLoadedClass(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + try { > + result = AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() { > + return JNLPClassLoader.super.findLoadedClass(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + result = null; > + } > + } else { > result = loaders[i].findLoadedClassAll(name); > + } > > if (result != null) > return result; > @@ -1521,12 +1542,20 @@ > protected Class findClass(String name) throws ClassNotFoundException { > for (int i = 0; i< loaders.length; i++) { > try { > - if (loaders[i] == this) > - return super.findClass(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + return AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() throws ClassNotFoundException { > + return JNLPClassLoader.super.findClass(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } else { > return loaders[i].findClass(name); > + } > } catch (ClassNotFoundException ex) { > } catch (ClassFormatError cfe) { > + } catch (PrivilegedActionException pae) { > } > } > > @@ -1635,20 +1664,42 @@ > */ > private Enumeration findResourcesBySearching(String name) throws IOException { > List resources = new ArrayList(); > - Enumeration e; > + Enumeration e = null; > > for (int i = 0; i< loaders.length; i++) { > // TODO check if this will blow up or not > // if loaders[1].getResource() is called, wont it call getResource() on > // the original caller? infinite recursion? > > - if (loaders[i] == this) > - e = super.findResources(name); > - else > + if (loaders[i] == this) { > + final String fName = name; > + try { > + e = AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Enumeration run() throws IOException { > + return JNLPClassLoader.super.findResources(fName); > + } > + }, getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + } > + } else { > e = loaders[i].findResources(name); > + } > > - while (e.hasMoreElements()) > - resources.add(e.nextElement()); > + final Enumeration fURLEnum = e; > + try { > + resources.addAll(AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Collection run() { > + List resources = new ArrayList(); > + while (fURLEnum != null&& fURLEnum.hasMoreElements()) { > + resources.add(fURLEnum.nextElement()); > + } > + return resources; > + } > + }, getAccessControlContextForClassLoading())); > + } catch (PrivilegedActionException pae) { > + } > } > > // Add resources from codebase (only if nothing was found above, > @@ -1900,6 +1951,56 @@ > } > } > > + /** > + * Returns an appropriate AccessControlContext for loading classes in > + * the running instance. > + * > + * The default context during class-loading only allows connection to > + * codebase. However applets are allowed to load jars from arbitrary > + * locations and the codebase only access falls short if a class from > + * one location needs a class from another. > + * > + * Given protected access since CodeBaseClassloader uses this function too. > + * > + * @return The appropriate AccessControlContext for loading classes for this instance > + */ > + public AccessControlContext getAccessControlContextForClassLoading() { > + AccessControlContext context = AccessController.getContext(); > + > + try { > + context.checkPermission(new AllPermission()); > + return context; // If context already has all permissions, don't bother > + } catch (AccessControlException ace) { > + // continue below > + } > + > + // Since this is for class-loading, technically any class from one jar > + // should be able to access a class from another, therefore making the > + // original context code source irrelevant > + PermissionCollection permissions = this.security.getSandBoxPermissions(); > + > + // Local cache access permissions > + for (Permission resourcePermission : resourcePermissions) { > + permissions.add(resourcePermission); > + } > + > + // Permissions for all remote hosting urls > + for (URL u: jarLocationSecurityMap.keySet()) { > + permissions.add(new SocketPermission(u.getHost(), > + "connect, accept")); > + } > + > + // Permissions for codebase urls > + for (URL u : codeBaseLoader.getURLs()) { > + permissions.add(new SocketPermission(u.getHost(), > + "connect, accept")); > + } > + > + ProtectionDomain pd = new ProtectionDomain(null, permissions); > + > + return new AccessControlContext(new ProtectionDomain[] { pd }); > + } > + > /* > * Helper class to expose protected URLClassLoader methods. > */ > @@ -1931,10 +2032,16 @@ > throw new ClassNotFoundException(name); > > try { > - return super.findClass(name); > - } catch (ClassNotFoundException cnfe) { > + final String fName = name; > + return AccessController.doPrivileged( > + new PrivilegedExceptionAction>() { > + public Class run() throws ClassNotFoundException { > + return CodeBaseClassLoader.super.findClass(fName); > + } > + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > notFoundResources.put(name, super.getURLs()); > - throw cnfe; > + throw new ClassNotFoundException("Could not find class " + name); > } > } > > @@ -1987,8 +2094,18 @@ > if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) > return null; > > + URL url = null; > if (!name.startsWith("META-INF")) { > - URL url = super.findResource(name); > + try { > + final String fName = name; > + url = AccessController.doPrivileged( > + new PrivilegedExceptionAction() { > + public URL run() { > + return CodeBaseClassLoader.super.findResource(fName); > + } > + }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > + } catch (PrivilegedActionException pae) { > + } > > if (url == null) { > notFoundResources.put(name, super.getURLs()); From aph at redhat.com Wed Jun 6 07:22:34 2012 From: aph at redhat.com (Andrew Haley) Date: Wed, 06 Jun 2012 15:22:34 +0100 Subject: ARM: Fix JIT bug that miscompiles Eclipse Message-ID: <4FCF67AA.1000404@redhat.com> Eclipse sometimes hangs with the current ARM JIT. It turns out that we are corrupting the count operand in a << b If b lives in a local it gets ANDed with 31. Most shift counts are less than 31 so it doesn't usually matter. In Eclipse, though, we have for (int i = 1; i <= 32; i++) { if ((sourcePriority & (1 << i)) != 0) { ... } } This never terminates because each time around the loop i is ANDed with 31. I guess that this loop should really be for (int i = 0; i < 32; i++) { i.e. this may be a bug in Eclipse. But we shouldn't miscompile it. I think this bug has been in the ARM JIT for quite a long time. I also took the opportunity to ask the CompilerOracle which methods should be JIT-compiled. This means we now have the flexibility to disable specific method compilation from the command line. Andrew. # HG changeset patch # User aph # Date 1338991762 14400 # Node ID 51380f2370a7c982f09dc1070c6c1c66218b5600 # Parent d1154290751107fc148173d73bc0cdef145f2230 Fix JIT bug that miscompiles org.eclipse.ui.internal.contexts.ContextAuthority.sourceChanged 2012-06-06 Andrew Haley * thumb2.cpp (Thumb2_Compile): Ask the CompilerOracle if we should compile this method. (Thumb2_iOp): Use a temporary to hold the shift count. diff -r d11542907511 -r 51380f2370a7 src/cpu/zero/vm/thumb2.cpp --- a/src/cpu/zero/vm/thumb2.cpp Thu May 31 06:42:18 2012 -0400 +++ b/src/cpu/zero/vm/thumb2.cpp Wed Jun 06 10:09:22 2012 -0400 @@ -68,6 +68,7 @@ #include #include "precompiled.hpp" #include "interpreter/bytecodes.hpp" +#include "compiler/compilerOracle.hpp" #define opc_nop 0x00 #define opc_aconst_null 0x01 @@ -3969,8 +3970,12 @@ case opc_ishl: case opc_ishr: case opc_iushr: - and_imm(jinfo->codebuf, r_rho, r_rho, 31); - break; + { + unsigned tmp_reg = Thumb2_Tmp(jinfo, 1 << r_lho | 1 << r_rho | 1 << r); + and_imm(jinfo->codebuf, tmp_reg, r_rho, 31); + r_rho = tmp_reg; + break; + } } dop_reg(jinfo->codebuf, dOps[opc-opc_iadd], r, r_lho, r_rho, 0, 0); } @@ -7044,10 +7049,15 @@ if (!(CPUInfo & ARCH_THUMB2)) UseCompiler = false; - if (!UseCompiler || method->is_not_compilable()) { - ic->set(ic->state(), 1); - bc->set(ic->state(), 1); - return 0; + { + bool ignore; + methodHandle mh(thread, method); + if (!UseCompiler || method->is_not_compilable() + || CompilerOracle::should_exclude(mh, ignore)) { + ic->set(ic->state(), 1); + bc->set(ic->state(), 1); + return 0; + } } slow_entry = *(unsigned *)method->from_interpreted_entry(); From andrew at icedtea.classpath.org Wed Jun 6 10:00:32 2012 From: andrew at icedtea.classpath.org (andrew at icedtea.classpath.org) Date: Wed, 06 Jun 2012 17:00:32 +0000 Subject: /hg/icedtea6-hg: Remove 6610244; patch upstreamed. Message-ID: changeset 244fd5d980de in /hg/icedtea6-hg details: http://icedtea.classpath.org/hg/icedtea6-hg?cmd=changeset;node=244fd5d980de author: Andrew John Hughes date: Wed Jun 06 18:00:06 2012 +0100 Remove 6610244; patch upstreamed. 2012-06-06 Andrew John Hughes * patches/openjdk/6610244-modal-fatal-error-windows.patch: Removed. * Makefile.am, Remove upstreamed patch. diffstat: ChangeLog | 7 + Makefile.am | 1 - patches/openjdk/6610244-modal-fatal-error-windows.patch | 125 ---------------- 3 files changed, 7 insertions(+), 126 deletions(-) diffs (154 lines): diff -r dc9ce5c9dbc1 -r 244fd5d980de ChangeLog --- a/ChangeLog Wed May 16 13:01:42 2012 +0100 +++ b/ChangeLog Wed Jun 06 18:00:06 2012 +0100 @@ -1,3 +1,10 @@ +2012-06-06 Andrew John Hughes + + * patches/openjdk/6610244-modal-fatal-error-windows.patch: + Removed. + * Makefile.am, + Remove upstreamed patch. + 2012-05-16 Andrew John Hughes * Makefile.am: diff -r dc9ce5c9dbc1 -r 244fd5d980de Makefile.am --- a/Makefile.am Wed May 16 13:01:42 2012 +0100 +++ b/Makefile.am Wed Jun 06 18:00:06 2012 +0100 @@ -199,7 +199,6 @@ ICEDTEA_PATCHES = \ $(SECURITY_PATCHES) \ - patches/openjdk/6610244-modal-fatal-error-windows.patch \ patches/stdc-limit-macros.patch \ patches/openjdk/4993545-nativeinlightfixer.patch \ patches/openjdk/6637796-set_bounds.patch \ diff -r dc9ce5c9dbc1 -r 244fd5d980de patches/openjdk/6610244-modal-fatal-error-windows.patch --- a/patches/openjdk/6610244-modal-fatal-error-windows.patch Wed May 16 13:01:42 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -# HG changeset patch -# User dav -# Date 1206447363 -10800 -# Node ID 58c90502785df64cd26e9f2d400429dcfcaa3b91 -# Parent de9e902b1f24bef3ec7248890caa1722983e68f5 -6610244: modal dialog closes with fatal error if -Xcheck:jni is set -Summary: obtain WWindowPeer class every time it is required -Reviewed-by: art - -diff -r de9e902b1f24 -r 58c90502785d src/windows/native/sun/windows/awt_Dialog.cpp ---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Dialog.cpp Mon Mar 24 18:24:15 2008 +0300 -+++ openjdk/jdk/src/windows/native/sun/windows/awt_Dialog.cpp Tue Mar 25 15:16:03 2008 +0300 -@@ -428,8 +428,12 @@ - { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - -- jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(AwtWindow::wwindowPeerCls, -- AwtWindow::getActiveWindowsMID)); -+ jclass wwindowPeerCls = env->FindClass("sun/awt/windows/WWindowPeer"); -+ jmethodID getActiveWindowsMID = env->GetStaticMethodID(wwindowPeerCls, -+ "getActiveWindowHandles", "()[J"); -+ DASSERT(getActiveWindowsMID != NULL); -+ jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(wwindowPeerCls, -+ getActiveWindowsMID)); - if (windows == NULL) { - return; - } -diff -r de9e902b1f24 -r 58c90502785d src/windows/native/sun/windows/awt_Window.cpp ---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.cpp Mon Mar 24 18:24:15 2008 +0300 -+++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.cpp Tue Mar 25 15:16:03 2008 +0300 -@@ -122,9 +122,6 @@ - jfieldID AwtWindow::locationByPlatformID; - jfieldID AwtWindow::autoRequestFocusID; - --jclass AwtWindow::wwindowPeerCls; --jmethodID AwtWindow::getActiveWindowsMID; -- - jfieldID AwtWindow::sysXID; - jfieldID AwtWindow::sysYID; - jfieldID AwtWindow::sysWID; -diff -r de9e902b1f24 -r 58c90502785d src/windows/native/sun/windows/awt_Window.h ---- openjdk.orig/jdk/src/windows/native/sun/windows/awt_Window.h Mon Mar 24 18:24:15 2008 +0300 -+++ openjdk/jdk/src/windows/native/sun/windows/awt_Window.h Tue Mar 25 15:16:03 2008 +0300 -@@ -57,11 +57,6 @@ - static jfieldID screenID; /* screen number passed over from WindowPeer */ - static jfieldID autoRequestFocusID; - -- /* WWindowPeer class */ -- static jclass wwindowPeerCls; -- /* long[] getActiveWindowHandles() method in WWindowPeer */ -- static jmethodID getActiveWindowsMID; -- - // The coordinates at the peer. - static jfieldID sysXID; - static jfieldID sysYID; -diff -r de9e902b1f24 -r 58c90502785d test/java/awt/Dialog/CrashXCheckJni/CrashXCheckJni.java ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ openjdk/jdk/test/java/awt/Dialog/CrashXCheckJni/CrashXCheckJni.java Tue Mar 25 15:16:03 2008 +0300 -@@ -0,0 +1,64 @@ -+/* -+ * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code 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 -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, -+ * CA 95054 USA or visit www.sun.com if you need additional information or -+ * have any questions. -+ */ -+ -+/* -+ @test -+ @bug 6610244 -+ @library ../../regtesthelpers -+ @build Util Sysout AbstractTest -+ @summary modal dialog closes with fatal error if -Xcheck:jni is set -+ @author Andrei Dmitriev : area=awt.dialog -+ @run main/othervm -Xcheck:jni CrashXCheckJni -+*/ -+ -+import java.awt.*; -+import java.awt.event.*; -+import java.util.Timer; -+import java.util.TimerTask; -+import test.java.awt.regtesthelpers.Util; -+import test.java.awt.regtesthelpers.AbstractTest; -+import test.java.awt.regtesthelpers.Sysout; -+ -+public class CrashXCheckJni { -+ -+ public static void main(String []s) -+ { -+ final Dialog fd = new Dialog(new Frame(), true); -+ Timer t = new Timer(); -+ t.schedule(new TimerTask() { -+ -+ public void run() { -+ System.out.println("RUNNING TASK"); -+ fd.setVisible(false); -+ fd.dispose(); -+ System.out.println("FINISHING TASK"); -+ } -+ }, 3000L); -+ -+ fd.setVisible(true); -+ t.cancel(); -+ Util.waitForIdle(null); -+ -+ AbstractTest.pass(); -+ } -+} -exporting patch: - From bugzilla-daemon at icedtea.classpath.org Wed Jun 6 11:05:22 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Wed, 06 Jun 2012 18:05:22 +0000 Subject: [Bug 1029] Error in web access to HP procurve switches In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1029 --- Comment #1 from Deepak Bhole --- Hi, can you please run it with: ICEDTEAPLUGIN_DEBUG=true firefox 2>&1 | tee console.log and attach the console.log and ~/.icedtea/log/* files? -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120606/7c06f362/attachment.html From dbhole at redhat.com Wed Jun 6 10:51:36 2012 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 6 Jun 2012 13:51:36 -0400 Subject: /hg/icedtea-web: PR861: Allow loading from non codebase hosts. A... In-Reply-To: <4FCF59B0.6040104@redhat.com> References: <4FCF59B0.6040104@redhat.com> Message-ID: <20120606175135.GJ30821@redhat.com> * Jiri Vanek [2012-06-06 09:31]: > Hi! > > This patch have broken most of javaws reproducers. I'm suggesting to > revert it until it is discovered why. Blame is on my head. > Sorry. > Hi Jiri, Thanks for spotting it. Sorry for missing it myself too :/ I will make sure I run the tests with a proper clean tree from now before push. I found the error, please see attached patch. ChangeLog: 2012-06-06 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getAccessControlContextForClassLoading): Iterate over codebase URLs only if codeBaseLoader is not null. After this, the pass rate is back to same as before. OK for push? Thanks, Deepak > J. > On 06/05/2012 05:00 PM, dbhole at icedtea.classpath.org wrote: > >changeset 954131311826 in /hg/icedtea-web > >details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=954131311826 > >author: Deepak Bhole > >date: Tue Jun 05 10:11:09 2012 -0400 > > > > PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server > > > > > >diffstat: > > > > ChangeLog | 20 ++ > > NEWS | 1 + > > netx/net/sourceforge/jnlp/SecurityDesc.java | 2 +- > > netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 149 +++++++++++++++- > > 4 files changed, 155 insertions(+), 17 deletions(-) > > > >diffs (285 lines): > > > >diff -r 67c462561ee3 -r 954131311826 ChangeLog > >--- a/ChangeLog Tue Jun 05 16:39:27 2012 +0200 > >+++ b/ChangeLog Tue Jun 05 10:11:09 2012 -0400 > >@@ -1,3 +1,23 @@ > >+2012-06-05 Deepak Bhole > >+ > >+ PR861: Allow loading from non codebase hosts. Allow code to connect to > >+ hosting server. > >+ * netx/net/sourceforge/jnlp/SecurityDesc.java > >+ (getSandBoxPermissions): Only add host if it is not empty. > >+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > >+ (getPermissions): Add SocketPermission for code source host. > >+ (findLoadedClassAll): Call super methods privileged so that connection to > >+ non codebase hosts can be made. > >+ (findClass): Same. > >+ (findResourcesBySearching): Same. Also use privileged context for enum > >+ operations because the enum is defined on the fly by URLClassLoader and > >+ checks for hosting server connectivity via next(). > >+ (getAccessControlContextForClassLoading): New method. Returns a control > >+ context for classloader operations like find/load/etc. > >+ (CodeBaseClassLoader::findClass): Call super methods privileged so that > >+ connection to non codebase hosts can be made. > >+ (CodeBaseClassLoader::findResource): Same. > >+ > > 2012-06-05 Jiri Vanek > > > > * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java > >diff -r 67c462561ee3 -r 954131311826 NEWS > >--- a/NEWS Tue Jun 05 16:39:27 2012 +0200 > >+++ b/NEWS Tue Jun 05 10:11:09 2012 -0400 > >@@ -16,6 +16,7 @@ > > - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp > > - PR863: Error passing strings to applet methods in Chromium > > - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass > >+ - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server > > * Common > > - PR918: java applet windows uses a low resulution black/white icon > > > >diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/SecurityDesc.java > >--- a/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 16:39:27 2012 +0200 > >+++ b/netx/net/sourceforge/jnlp/SecurityDesc.java Tue Jun 05 10:11:09 2012 -0400 > >@@ -238,7 +238,7 @@ > > for (int i = 0; i< jnlpRIAPermissions.length; i++) > > permissions.add(jnlpRIAPermissions[i]); > > > >- if (downloadHost != null) > >+ if (downloadHost != null&& downloadHost.length()> 0) > > permissions.add(new SocketPermission(downloadHost, > > "connect, accept")); > > > >diff -r 67c462561ee3 -r 954131311826 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > >--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 16:39:27 2012 +0200 > >+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 10:11:09 2012 -0400 > >@@ -25,9 +25,11 @@ > > import java.io.InputStream; > > import java.io.InputStreamReader; > > import java.net.MalformedURLException; > >+import java.net.SocketPermission; > > import java.net.URL; > > import java.net.URLClassLoader; > > import java.security.AccessControlContext; > >+import java.security.AccessControlException; > > import java.security.AccessController; > > import java.security.AllPermission; > > import java.security.CodeSource; > >@@ -35,9 +37,12 @@ > > import java.security.PermissionCollection; > > import java.security.Permissions; > > import java.security.PrivilegedAction; > >+import java.security.PrivilegedActionException; > > import java.security.PrivilegedExceptionAction; > >+import java.security.ProtectionDomain; > > import java.util.ArrayList; > > import java.util.Arrays; > >+import java.util.Collection; > > import java.util.Collections; > > import java.util.Enumeration; > > import java.util.HashMap; > >@@ -952,6 +957,11 @@ > > result.add(runtimePermissions.get(i)); > > } > > > >+ // Class from host X should be allowed to connect to host X > >+ if (cs.getLocation().getHost().length()> 0) > >+ result.add(new SocketPermission(cs.getLocation().getHost(), > >+ "connect, accept")); > >+ > > return result; > > } catch (RuntimeException ex) { > > if (JNLPRuntime.isDebug()) { > >@@ -1320,10 +1330,21 @@ > > for (int i = 0; i< loaders.length; i++) { > > Class result = null; > > > >- if (loaders[i] == this) > >- result = super.findLoadedClass(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ try { > >+ result = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() { > >+ return JNLPClassLoader.super.findLoadedClass(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ result = null; > >+ } > >+ } else { > > result = loaders[i].findLoadedClassAll(name); > >+ } > > > > if (result != null) > > return result; > >@@ -1521,12 +1542,20 @@ > > protected Class findClass(String name) throws ClassNotFoundException { > > for (int i = 0; i< loaders.length; i++) { > > try { > >- if (loaders[i] == this) > >- return super.findClass(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ return AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() throws ClassNotFoundException { > >+ return JNLPClassLoader.super.findClass(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } else { > > return loaders[i].findClass(name); > >+ } > > } catch (ClassNotFoundException ex) { > > } catch (ClassFormatError cfe) { > >+ } catch (PrivilegedActionException pae) { > > } > > } > > > >@@ -1635,20 +1664,42 @@ > > */ > > private Enumeration findResourcesBySearching(String name) throws IOException { > > List resources = new ArrayList(); > >- Enumeration e; > >+ Enumeration e = null; > > > > for (int i = 0; i< loaders.length; i++) { > > // TODO check if this will blow up or not > > // if loaders[1].getResource() is called, wont it call getResource() on > > // the original caller? infinite recursion? > > > >- if (loaders[i] == this) > >- e = super.findResources(name); > >- else > >+ if (loaders[i] == this) { > >+ final String fName = name; > >+ try { > >+ e = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Enumeration run() throws IOException { > >+ return JNLPClassLoader.super.findResources(fName); > >+ } > >+ }, getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ } > >+ } else { > > e = loaders[i].findResources(name); > >+ } > > > >- while (e.hasMoreElements()) > >- resources.add(e.nextElement()); > >+ final Enumeration fURLEnum = e; > >+ try { > >+ resources.addAll(AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Collection run() { > >+ List resources = new ArrayList(); > >+ while (fURLEnum != null&& fURLEnum.hasMoreElements()) { > >+ resources.add(fURLEnum.nextElement()); > >+ } > >+ return resources; > >+ } > >+ }, getAccessControlContextForClassLoading())); > >+ } catch (PrivilegedActionException pae) { > >+ } > > } > > > > // Add resources from codebase (only if nothing was found above, > >@@ -1900,6 +1951,56 @@ > > } > > } > > > >+ /** > >+ * Returns an appropriate AccessControlContext for loading classes in > >+ * the running instance. > >+ * > >+ * The default context during class-loading only allows connection to > >+ * codebase. However applets are allowed to load jars from arbitrary > >+ * locations and the codebase only access falls short if a class from > >+ * one location needs a class from another. > >+ * > >+ * Given protected access since CodeBaseClassloader uses this function too. > >+ * > >+ * @return The appropriate AccessControlContext for loading classes for this instance > >+ */ > >+ public AccessControlContext getAccessControlContextForClassLoading() { > >+ AccessControlContext context = AccessController.getContext(); > >+ > >+ try { > >+ context.checkPermission(new AllPermission()); > >+ return context; // If context already has all permissions, don't bother > >+ } catch (AccessControlException ace) { > >+ // continue below > >+ } > >+ > >+ // Since this is for class-loading, technically any class from one jar > >+ // should be able to access a class from another, therefore making the > >+ // original context code source irrelevant > >+ PermissionCollection permissions = this.security.getSandBoxPermissions(); > >+ > >+ // Local cache access permissions > >+ for (Permission resourcePermission : resourcePermissions) { > >+ permissions.add(resourcePermission); > >+ } > >+ > >+ // Permissions for all remote hosting urls > >+ for (URL u: jarLocationSecurityMap.keySet()) { > >+ permissions.add(new SocketPermission(u.getHost(), > >+ "connect, accept")); > >+ } > >+ > >+ // Permissions for codebase urls > >+ for (URL u : codeBaseLoader.getURLs()) { > >+ permissions.add(new SocketPermission(u.getHost(), > >+ "connect, accept")); > >+ } > >+ > >+ ProtectionDomain pd = new ProtectionDomain(null, permissions); > >+ > >+ return new AccessControlContext(new ProtectionDomain[] { pd }); > >+ } > >+ > > /* > > * Helper class to expose protected URLClassLoader methods. > > */ > >@@ -1931,10 +2032,16 @@ > > throw new ClassNotFoundException(name); > > > > try { > >- return super.findClass(name); > >- } catch (ClassNotFoundException cnfe) { > >+ final String fName = name; > >+ return AccessController.doPrivileged( > >+ new PrivilegedExceptionAction>() { > >+ public Class run() throws ClassNotFoundException { > >+ return CodeBaseClassLoader.super.findClass(fName); > >+ } > >+ }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > > notFoundResources.put(name, super.getURLs()); > >- throw cnfe; > >+ throw new ClassNotFoundException("Could not find class " + name); > > } > > } > > > >@@ -1987,8 +2094,18 @@ > > if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) > > return null; > > > >+ URL url = null; > > if (!name.startsWith("META-INF")) { > >- URL url = super.findResource(name); > >+ try { > >+ final String fName = name; > >+ url = AccessController.doPrivileged( > >+ new PrivilegedExceptionAction() { > >+ public URL run() { > >+ return CodeBaseClassLoader.super.findResource(fName); > >+ } > >+ }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); > >+ } catch (PrivilegedActionException pae) { > >+ } > > > > if (url == null) { > > notFoundResources.put(name, super.getURLs()); > -------------- next part -------------- diff -r 954131311826 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 10:11:09 2012 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Wed Jun 06 13:47:48 2012 -0400 @@ -1990,10 +1990,12 @@ "connect, accept")); } - // Permissions for codebase urls - for (URL u : codeBaseLoader.getURLs()) { - permissions.add(new SocketPermission(u.getHost(), - "connect, accept")); + // Permissions for codebase urls (if there is a loader) + if (codeBaseLoader != null) { + for (URL u : codeBaseLoader.getURLs()) { + permissions.add(new SocketPermission(u.getHost(), + "connect, accept")); + } } ProtectionDomain pd = new ProtectionDomain(null, permissions); From adomurad at redhat.com Wed Jun 6 12:12:17 2012 From: adomurad at redhat.com (Adam Domurad) Date: Wed, 06 Jun 2012 15:12:17 -0400 Subject: [icedtea-web] RFC: use tagsoup to try and parse malformed JNLP files Message-ID: <1339009937.24497.71.camel@voip-10-15-18-79.yyz.redhat.com> I have attached the patch of what I ended up with after applying the patch to the recent code, to make further review easier hopefully. I have also attached only the updated test changes from the same patch. (Note that my changes to Makefile.am are dubious, I was just doing what was necessary to test the patch.) I'd appreciate if another reviewer ran the tests as I'm having trouble getting with running a few of them (in general). From what I see though this patch passes more tests than normal, including two of the malformed XML unit tests. >From what I've seen the changes to the code look solid, I'd comment more but I'm not too sure of the impact of some of the changes. > Hi, > > I have come across a number of JNLP files that are not valid xml. Netx > can not parse these files using a xml parser, and fails to run them. I > spent some time looking for a solution and came across TagSoup[1]. The > TagSoup library parses a malformed HTML document into a well-formed > xml-like HTML document, but it works almost perfectly for our purposes too. > > The attached patch makes use of TagSoup for parsing input jnlp files. > > Parsing is currently implemented in two passes. In the first pass, > TagSoup reads the "xml" (which can be malformed and hence not really > xml), and outputs valid XML. Netx then uses this valid XML and uses it's > own XML parser to parse the file. > > The patch requires TagSoup as an optional dependency. To use TagSoup, > run configure (--with-tagsoup can be used to point to a TagSoup jar). To > not use TagSoup (even if it installed), use --with-tagsoup=no > > The patch also adds an additional command line option, -xml ,to the > javaws binary. This option can be used to force Netx to use the normal > xml parser instead of TagSoup to parse the jnlp file. > > Any thoughts or comments? > > ChangeLog: > 2011-01-10 Omair Majid > > * Makefile.am: Add NETX_EXCLUDE_SRCS, NETX_DUMMY_CLASSPATH > (netx-source-files.txt): Selectively exclude some sources from > compilation. > (stamps/netx.stamp): Depend on netx-dummy.jar > (netx-dummy.jar): New target. Empty jar. Used so there is always at > least one class on the classpath. > ($(NETX_DIR)/launcher/%.o): Add classpath. > * NEWS: Update with fix. > * acinclude.m4: Add IT_CHECK_FOR_TAGSOUP. > * configure.ac: Call IT_CHECK_FOR_TAGSOUP. > * netx/net/sourceforge/jnlp/JNLPFile.java: Add new member > parserSettings. > (JNLPFile(URL)): Pass a ParserSettings object. > (JNLPFile(URL,boolean)): Refactored into... > (JNLPFile(URL,ParserSettings)): New method. > (JNLPFile(URL,Version,boolean)): Refactored into... > (JNLPFile(URL,Version,ParserSettings)): New method. > (JNLPFile(URL,Version,boolean,UpdatePolicy)): Refactored into... > (JNLPFile(URL,Version,ParserSettings,UpdatePolicy)): New method. > (JNLPFile(URL,String,Version,boolean,UpdatePolicy)): Refactored > into... > (JNLPFile(URL,String,Version,ParserSettings,UpdatePolicy)): New > method. > (JNLPFile(InputStream,boolean)): Refactored into... > (JNLPFile(InputStream,ParserSettings)): New method. > (getParserSettings): New method. > (parse(Node,boolean,URL)): Refactored into... > (parse(InputStream,URL)): New method. Invoke parser to get the root > node and then parse it. > * netx/net/sourceforge/jnlp/Launcher.java > (toFile): Use new ParserSettings object. > * netx/net/sourceforge/jnlp/Parser.java > (Parser(JNLPFile,URL,Node,boolean,boolean)): Refactored into... > (Parser(JNLPFile,URL,Node,ParserSettings)): New method. > (getRootNode): Implementation moved into XMLParser.getRootNode. > Selects the right subclass of XMLParser to use. > (getEncoding): Moved to XMLParser. > * netx/net/sourceforge/jnlp/ParserSettings.java: New file. > (ParserSettings): New method. > (ParserSettings(boolean,boolean,boolean)): New method. > (isExtensionAllowed): New method. > (isMalfromedXmlAllowed): New method. > (isStrict): New method. > * netx/net/sourceforge/jnlp/XMLParser.java > (getRootNode): New method. Contains implementation from > Parser.getRootNode. > (getEncoding): New method. Moved from Parser. > * netx/net/sourceforge/jnlp/MalformedXMLParser.java: New file. > (getRootNode): New method. Transform input into valid xml and > delegate to parent to parse it. > (xmlizeInputStream): New method. Read contents from an input stream > and transform it into valid xml. > * netx/net/sourceforge/jnlp/resources/Messages.properties: Add > BOXml. > * netx/net/sourceforge/jnlp/runtime/Boot.java: Add -xml option. > (getFile): Parse -xml option and create a new ParserSettings object > based on it. > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > (getInstance(URL,String,Version,UpdatePolicy)): Refactored into... > (getInstance(URL,String,Version,ParserSettings,UpdatePolicy): New > method. > (initializeExtensions): Use the same parser settings to parse the > extension as used in the original file. > > Cheers, > Omair > > [1] http://home.ccil.org/~cowan/XML/tagsoup/ -------------- next part -------------- A non-text attachment was scrubbed... Name: update_to_patch.patch Type: text/x-patch Size: 41912 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120606/d8aefd52/update_to_patch.patch -------------- next part -------------- A non-text attachment was scrubbed... Name: test_changes.patch Type: text/x-patch Size: 9776 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120606/d8aefd52/test_changes.patch From omajid at redhat.com Wed Jun 6 12:48:36 2012 From: omajid at redhat.com (Omair Majid) Date: Wed, 06 Jun 2012 15:48:36 -0400 Subject: [RFC][icedtea-web]: Configure browser paths In-Reply-To: <4FCE21B6.2030806@redhat.com> References: <4FCCF312.2020504@redhat.com> <4FCD032D.4040806@redhat.com> <4FCE21B6.2030806@redhat.com> Message-ID: <4FCFB414.1080605@redhat.com> Hi Saad, On 06/05/2012 11:11 AM, Saad Mohammad wrote: > I have attached the patch with all the suggested changes. > > > Thanks for the review Omair. Some comments (nits, really) below. > + > +dnl REQUIRED Parameters: > +dnl [browser name, variable to store path, terminal command to run browser (if installed), otherwise use the browser name] A one-line summary of what this does would be nice to have. > + if test $# -gt 2; then > + AC_PATH_TOOL([$2], [$3], [], [$PATH]) > + else > + AC_PATH_TOOL([$2], [$1], [], [$PATH]) I believe you can leave out the $PATH argument. > + fi > + else > + AC_MSG_CHECKING([for $1]) > + AC_MSG_RESULT([no]) > + fi I wish there was a way to have fewer places doing an AC_MSG_CHECKING. If you can find a way, that would be great. Otherwise it's fine as it is. Please commit this after fixing the two nits above. Thanks, Omair From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 00:01:57 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 07:01:57 +0000 Subject: [Bug 1029] Error in web access to HP procurve switches In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1029 --- Comment #2 from jpcozar at yahoo.es --- Created attachment 701 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=701&action=edit console.log console.log -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/88b52c16/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 00:02:57 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 07:02:57 +0000 Subject: [Bug 1029] Error in web access to HP procurve switches In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1029 --- Comment #3 from jpcozar at yahoo.es --- Created attachment 702 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=702&action=edit java.stderr -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/1cdd5289/attachment.html From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 00:06:07 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 07:06:07 +0000 Subject: [Bug 1029] Error in web access to HP procurve switches In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1029 --- Comment #4 from jpcozar at yahoo.es --- (In reply to comment #1) > Hi, can you please run it with: > > ICEDTEAPLUGIN_DEBUG=true firefox 2>&1 | tee console.log > > and attach the console.log and ~/.icedtea/log/* files? Naturally I can do that :-), thank you for the answer. I've attached files you asked me. java.stdout is empty. -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/e86723ce/attachment.html From adinn at redhat.com Thu Jun 7 01:17:16 2012 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 07 Jun 2012 09:17:16 +0100 Subject: ARM : fix bug in indy code caused by the ARM JIT optimization patch Message-ID: <4FD0638C.1080201@redhat.com> The recent ARM JIT optimization patch (ed's big patch) reassigned the register holding the current Java thread. This inadvertently broke invokedynamic calls because the call to CppInterpreter::method_handle_entry from fast_method_handle_entry is relying upon the thread handle already being in argument register r2. A move from the thread register to r2 before making the call to method method_handle_entry fixes the problem. See attached one line patch for precise details. regards, Andrew Dinn ----------- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch.txt Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/5a24bf34/patch.txt From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 02:23:30 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 09:23:30 +0000 Subject: [Bug 1039] New: unpredictable SIGSEGV libc.so.6 malloc_consolidate Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1039 Priority: P3 Bug ID: 1039 Assignee: unassigned at icedtea.classpath.org Summary: unpredictable SIGSEGV libc.so.6 malloc_consolidate Severity: major Classification: Unclassified OS: Linux Reporter: daniele.segato at gmail.com Hardware: x86_64 Status: NEW Version: 2.0 Component: IcedTea Product: IcedTea Created attachment 703 --> http://icedtea.classpath.org/bugzilla/attachment.cgi?id=703&action=edit stack trace of the JVM crash Hi, I've a server running with a Tomcat6 + some web application. The JVM was running by 15 days when it unexpectedly crashed on a malloc_consolidate No idea on how to reproduce it, I've already contacted who could have been working on the webapp while it crashed to know if they were using it and what were they doing to get some hint, if I get anything out of this I'll add a comment. Here's the head of the stack trace log (full log attached) # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f75dd50a3b5, pid=3411, tid=140143927764736 # # JRE version: 6.0_22-b22 # Java VM: OpenJDK 64-Bit Server VM (20.0-b11 mixed mode linux-amd64 compressed oops) # Derivative: IcedTea6 1.10.6 # Distribution: Amazon Linux BASE release 2012.03, package amazon-52.1.10.6.44.amzn1-x86_64 # Problematic frame: # C [libc.so.6+0x753b5] malloc_consolidate+0xf5 # # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # -- You are receiving this mail because: You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/0affa1ad/attachment.html From aph at redhat.com Thu Jun 7 04:04:21 2012 From: aph at redhat.com (Andrew Haley) Date: Thu, 07 Jun 2012 12:04:21 +0100 Subject: ARM : fix bug in indy code caused by the ARM JIT optimization patch In-Reply-To: <4FD0638C.1080201@redhat.com> References: <4FD0638C.1080201@redhat.com> Message-ID: <4FD08AB5.1020500@redhat.com> On 06/07/2012 09:17 AM, Andrew Dinn wrote: > The recent ARM JIT optimization patch (ed's big patch) reassigned the > register holding the current Java thread. This inadvertently broke > invokedynamic calls because the call to > CppInterpreter::method_handle_entry from fast_method_handle_entry is > relying upon the thread handle already being in argument register r2. A > move from the thread register to r2 before making the call to method > method_handle_entry fixes the problem. OK, thanks. Andrew. From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 04:11:22 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 11:11:22 +0000 Subject: [Bug 825] OpenOffice crash on opening file (attached) In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=825 Xerxes R?nby changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #8 from Xerxes R?nby --- LibreOffice 3.5 opens your document fine on Ubuntu 12.04 in combination with IcedTea 6 1.11.1 and IcedTea 7 2.1 as well. WORKSFORME resovles this bug fine, thank you for following up and re-validate your report. -- You are receiving this mail because: You are the assignee for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/8cfe2bcd/attachment.html From thomas at m3y3r.de Thu Jun 7 05:36:27 2012 From: thomas at m3y3r.de (Thomas Meyer) Date: Thu, 07 Jun 2012 14:36:27 +0200 Subject: [rfc][icedtea-web] reproducer for RH816592 (and PR858) In-Reply-To: <4FCDF596.1000209@redhat.com> References: <4FA152A2.1030600@redhat.com> <4FCDF596.1000209@redhat.com> Message-ID: <1339072587.3018.8.camel@localhost.localdomain> Am Dienstag, den 05.06.2012, 14:03 +0200 schrieb Jiri Vanek: > This test contains six tests. All are failing. Two applets in html, two applets in jnlp and two applications in jnlp > Three "new" variants are about to be fixed by little bit modified Thomas' patch[1] > three "hack" variants are about to be fixed by my patch [2] > All tests are also representing nullpointer exception fixed recently [3] > > Thomas fix have also fixed GeoGebra issue, so I have marked just "new" variants as reproducers for RH816592/PR858 as the "hack" test are reproducing little bit stronger missuses. > > [1]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018824.html > [2]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018372.html > [3]http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018813.html > > Thomas do you think this reproducer is enough to simulate yours patch to-be-fixed-issue? Hi Jiri, currently I'm really busy, sorry. I'll try to have a look at this the next week. with kind regards thomas > > 2012-05-06 Jiri Vanek > > Reproducer for RH816592 > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-hack.jnlp > jnlp launcher of applet variant with injecting new url to classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-new.jnlp > jnlp launcher of applet variant with custom classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.html > html launcher of applet variant with injecting new url to classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.jnlp > jnlp launcher of application variant with injecting new url to classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.html > html launcher of applet variant with custom classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.jnlp > jnlp launcher of application variant with custom classlaoder > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/srcs/InternalClassloaderWithDownloadedResource.java: > Both application and applet reproducing behavior of this bug > * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java: > Testcase launching jnlp application, jnlp applet and html applet > From jvanek at redhat.com Thu Jun 7 07:57:56 2012 From: jvanek at redhat.com (Jiri Vanek) Date: Thu, 07 Jun 2012 16:57:56 +0200 Subject: /hg/icedtea-web: PR861: Allow loading from non codebase hosts. A... In-Reply-To: <20120606175135.GJ30821@redhat.com> References: <4FCF59B0.6040104@redhat.com> <20120606175135.GJ30821@redhat.com> Message-ID: <4FD0C174.3070402@redhat.com> On 06/06/2012 07:51 PM, Deepak Bhole wrote: > * Jiri Vanek [2012-06-06 09:31]: >> Hi! >> >> This patch have broken most of javaws reproducers. I'm suggesting to >> revert it until it is discovered why. Blame is on my head. >> Sorry. >> > > Hi Jiri, > > Thanks for spotting it. Sorry for missing it myself too :/ I will make > sure I run the tests with a proper clean tree from now before push. > > I found the error, please see attached patch. > > ChangeLog: > 2012-06-06 Deepak Bhole > > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > (getAccessControlContextForClassLoading): Iterate over codebase URLs only > if codeBaseLoader is not null. > > > After this, the pass rate is back to same as before. > > OK for push? > Yap. go on. J. From dbhole at icedtea.classpath.org Thu Jun 7 08:12:11 2012 From: dbhole at icedtea.classpath.org (dbhole at icedtea.classpath.org) Date: Thu, 07 Jun 2012 15:12:11 +0000 Subject: /hg/icedtea-web: Fixed bug in previous commit for PR861 Message-ID: changeset 70a30f21de45 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=70a30f21de45 author: Deepak Bhole date: Thu Jun 07 11:12:03 2012 -0400 Fixed bug in previous commit for PR861 diffstat: ChangeLog | 6 ++++++ netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diffs (33 lines): diff -r 954131311826 -r 70a30f21de45 ChangeLog --- a/ChangeLog Tue Jun 05 10:11:09 2012 -0400 +++ b/ChangeLog Thu Jun 07 11:12:03 2012 -0400 @@ -1,3 +1,9 @@ +2012-06-06 Deepak Bhole + + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getAccessControlContextForClassLoading): Iterate over codebase URLs only + if codeBaseLoader is not null. + 2012-06-05 Deepak Bhole PR861: Allow loading from non codebase hosts. Allow code to connect to diff -r 954131311826 -r 70a30f21de45 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Jun 05 10:11:09 2012 -0400 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Jun 07 11:12:03 2012 -0400 @@ -1990,10 +1990,12 @@ "connect, accept")); } - // Permissions for codebase urls - for (URL u : codeBaseLoader.getURLs()) { - permissions.add(new SocketPermission(u.getHost(), - "connect, accept")); + // Permissions for codebase urls (if there is a loader) + if (codeBaseLoader != null) { + for (URL u : codeBaseLoader.getURLs()) { + permissions.add(new SocketPermission(u.getHost(), + "connect, accept")); + } } ProtectionDomain pd = new ProtectionDomain(null, permissions); From bugzilla-daemon at icedtea.classpath.org Thu Jun 7 08:12:20 2012 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Thu, 07 Jun 2012 15:12:20 +0000 Subject: [Bug 861] Code in a jar cannot connect to jar host server In-Reply-To: References: Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=861 --- Comment #4 from hg commits --- details: http://icedtea.classpath.org//hg/icedtea-web?cmd=changeset;node=70a30f21de45 author: Deepak Bhole date: Thu Jun 07 11:12:03 2012 -0400 Fixed bug in previous commit for PR861 -- You are receiving this mail because: You are on the CC list for the bug. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/34db7eef/attachment.html From dbhole at redhat.com Thu Jun 7 08:32:35 2012 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 7 Jun 2012 11:32:35 -0400 Subject: /hg/icedtea-web: PR861: Allow loading from non codebase hosts. A... In-Reply-To: <4FD0C174.3070402@redhat.com> References: <4FCF59B0.6040104@redhat.com> <20120606175135.GJ30821@redhat.com> <4FD0C174.3070402@redhat.com> Message-ID: <20120607153235.GQ30821@redhat.com> * Jiri Vanek [2012-06-07 10:57]: > On 06/06/2012 07:51 PM, Deepak Bhole wrote: > >* Jiri Vanek [2012-06-06 09:31]: > >>Hi! > >> > >>This patch have broken most of javaws reproducers. I'm suggesting to > >>revert it until it is discovered why. Blame is on my head. > >>Sorry. > >> > > > >Hi Jiri, > > > >Thanks for spotting it. Sorry for missing it myself too :/ I will make > >sure I run the tests with a proper clean tree from now before push. > > > >I found the error, please see attached patch. > > > >ChangeLog: > >2012-06-06 Deepak Bhole > > > > * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java > > (getAccessControlContextForClassLoading): Iterate over codebase URLs only > > if codeBaseLoader is not null. > > > > > >After this, the pass rate is back to same as before. > > > >OK for push? > > > > > Yap. go on. > Thanks! Pushed. Cheers, Deepak > J. From smohammad at icedtea.classpath.org Thu Jun 7 08:32:49 2012 From: smohammad at icedtea.classpath.org (smohammad at icedtea.classpath.org) Date: Thu, 07 Jun 2012 15:32:49 +0000 Subject: /hg/icedtea-web: Added the ability to configure (enable/disable/... Message-ID: changeset e696a47c3b89 in /hg/icedtea-web details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=e696a47c3b89 author: Saad Mohammad date: Thu Jun 07 11:31:27 2012 -0400 Added the ability to configure (enable/disable/set custom path to) browsers diffstat: ChangeLog | 8 ++++++++ acinclude.m4 | 37 +++++++++++++++++++++++++++++++++++++ configure.ac | 13 +++++++------ 3 files changed, 52 insertions(+), 6 deletions(-) diffs (82 lines): diff -r 70a30f21de45 -r e696a47c3b89 ChangeLog --- a/ChangeLog Thu Jun 07 11:12:03 2012 -0400 +++ b/ChangeLog Thu Jun 07 11:31:27 2012 -0400 @@ -1,3 +1,11 @@ +2012-06-07 Saad Mohammad + + Allows the user to configure browser paths and/or disable browsers. + * acinclude.m4 (IT_FIND_BROWSER): Checks if the browser is set to be + disabled, or if the path provided is valid. Otherwise, it locates the + default path to the browser if found on the system. + * configure.ac: Uses IT_FIND_BROWSER to find/configure browsers. + 2012-06-06 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java diff -r 70a30f21de45 -r e696a47c3b89 acinclude.m4 --- a/acinclude.m4 Thu Jun 07 11:12:03 2012 -0400 +++ b/acinclude.m4 Thu Jun 07 11:31:27 2012 -0400 @@ -880,3 +880,40 @@ AC_MSG_RESULT([${FULL_VERSION}]) AC_SUBST([FULL_VERSION]) ]) + +dnl Allows you to configure (enable/disable/set path to) the browser +dnl REQUIRED Parameters: +dnl [browser name, variable to store path, default command to run browser (if not provided, assume it's the same as the browser name] +AC_DEFUN([IT_FIND_BROWSER], +[ + AC_ARG_WITH([$1], + [AS_HELP_STRING(--with-$1,specify the location of $1)], + [ + if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then + $2="" + elif test -f "${withval}" ; then + $2="${withval}" + else + AC_MSG_CHECKING([for $1]) + AC_MSG_RESULT([not found]) + AC_MSG_FAILURE([invalid location specified to $1: ${withval}]) + fi + ], + [ + withval="yes" + ]) + + if test -f "${$2}"; then + AC_MSG_CHECKING([for $1]) + AC_MSG_RESULT([${$2}]) + elif test "${withval}" != "no"; then + if test $# -gt 2; then + AC_PATH_TOOL([$2], [$3], [], []) + else + AC_PATH_TOOL([$2], [$1], [], []) + fi + else + AC_MSG_CHECKING([for $1]) + AC_MSG_RESULT([no]) + fi +]) diff -r 70a30f21de45 -r e696a47c3b89 configure.ac --- a/configure.ac Thu Jun 07 11:12:03 2012 -0400 +++ b/configure.ac Thu Jun 07 11:31:27 2012 -0400 @@ -89,12 +89,13 @@ AC_CHECK_PROGS([XSLTPROC],[xsltproc],[], []) # browser to be linked/tested -AC_CHECK_PROGS([FIREFOX],[firefox],[], []) -AC_CHECK_PROGS([CHROME],[google-chrome],[], []) -AC_CHECK_PROGS([CHROMIUM],[chromium-browser],[], []) -AC_CHECK_PROGS([OPERA],[opera],[], []) -AC_CHECK_PROGS([MIDORI],[midori],[], []) -AC_CHECK_PROGS([EPIPHANY],[epiphany],[], []) +# Example: IT_FIND_BROWSER([browser-name],[variable-to-store-path],[default-run-command-if-different-from-the-browser-name]) +IT_FIND_BROWSER([firefox],[FIREFOX]) +IT_FIND_BROWSER([chrome],[CHROME],[google-chrome]) +IT_FIND_BROWSER([chromium],[CHROMIUM],[chromium-browser]) +IT_FIND_BROWSER([opera],[OPERA]) +IT_FIND_BROWSER([midori],[MIDORI]) +IT_FIND_BROWSER([epiphany],[EPIPHANY]) AM_CONDITIONAL([WITH_XSLTPROC], [test x"$XSLTPROC" != x ]) IT_FIND_OPTIONAL_JAR([rhino], RHINO, From adinn at redhat.com Thu Jun 7 09:45:22 2012 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 07 Jun 2012 17:45:22 +0100 Subject: ARM: Fix JIT bug that miscompiles Eclipse In-Reply-To: <4FCF67AA.1000404@redhat.com> References: <4FCF67AA.1000404@redhat.com> Message-ID: <4FD0DAA2.2030608@redhat.com> Ok, I managed to find a reproducer for this problem. You need a loop which uses the loop counter in a shift and then uses it afterwards in the loop body. See attached test class Test8. With the original JVM code this test hangs. It runs ok after the patch. The ASM listing for the two runs shows that the patch avoids the loop var being ANDed with 31 before the loop test is retried. So, the fix is good to go. regards, Andrew Dinn ----------- On 06/06/12 15:22, Andrew Haley wrote: > Eclipse sometimes hangs with the current ARM JIT. It turns out that we > are corrupting the count operand in > > a << b > > If b lives in a local it gets ANDed with 31. Most shift counts are > less than 31 so it doesn't usually matter. In Eclipse, though, we > have > > for (int i = 1; i <= 32; i++) { > if ((sourcePriority & (1 << i)) != 0) { > ... > } > } > > This never terminates because each time around the loop i is ANDed > with 31. > > I guess that this loop should really be > > for (int i = 0; i < 32; i++) { > > i.e. this may be a bug in Eclipse. But we shouldn't miscompile it. I > think this bug has been in the ARM JIT for quite a long time. > > I also took the opportunity to ask the CompilerOracle which methods > should be JIT-compiled. This means we now have the flexibility to > disable specific method compilation from the command line. > > Andrew. > > > # HG changeset patch > # User aph > # Date 1338991762 14400 > # Node ID 51380f2370a7c982f09dc1070c6c1c66218b5600 > # Parent d1154290751107fc148173d73bc0cdef145f2230 > Fix JIT bug that miscompiles org.eclipse.ui.internal.contexts.ContextAuthority.sourceChanged > 2012-06-06 Andrew Haley > > * thumb2.cpp (Thumb2_Compile): Ask the CompilerOracle if we should > compile this method. > (Thumb2_iOp): Use a temporary to hold the shift count. > > diff -r d11542907511 -r 51380f2370a7 src/cpu/zero/vm/thumb2.cpp > --- a/src/cpu/zero/vm/thumb2.cpp Thu May 31 06:42:18 2012 -0400 > +++ b/src/cpu/zero/vm/thumb2.cpp Wed Jun 06 10:09:22 2012 -0400 > @@ -68,6 +68,7 @@ > #include > #include "precompiled.hpp" > #include "interpreter/bytecodes.hpp" > +#include "compiler/compilerOracle.hpp" > > #define opc_nop 0x00 > #define opc_aconst_null 0x01 > @@ -3969,8 +3970,12 @@ > case opc_ishl: > case opc_ishr: > case opc_iushr: > - and_imm(jinfo->codebuf, r_rho, r_rho, 31); > - break; > + { > + unsigned tmp_reg = Thumb2_Tmp(jinfo, 1 << r_lho | 1 << r_rho | 1 << r); > + and_imm(jinfo->codebuf, tmp_reg, r_rho, 31); > + r_rho = tmp_reg; > + break; > + } > } > dop_reg(jinfo->codebuf, dOps[opc-opc_iadd], r, r_lho, r_rho, 0, 0); > } > @@ -7044,10 +7049,15 @@ > if (!(CPUInfo & ARCH_THUMB2)) > UseCompiler = false; > > - if (!UseCompiler || method->is_not_compilable()) { > - ic->set(ic->state(), 1); > - bc->set(ic->state(), 1); > - return 0; > + { > + bool ignore; > + methodHandle mh(thread, method); > + if (!UseCompiler || method->is_not_compilable() > + || CompilerOracle::should_exclude(mh, ignore)) { > + ic->set(ic->state(), 1); > + bc->set(ic->state(), 1); > + return 0; > + } > } > > slow_entry = *(unsigned *)method->from_interpreted_entry(); > > > > > -- regards, Andrew Dinn ----------- Principal Software Engineer Red Hat UK Ltd Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson (USA), Charlie Peters (USA) -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: asm-listings.txt Url: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/543b7e1d/asm-listings.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: Test8.java Type: text/x-java Size: 371 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120607/543b7e1d/Test8.java From adinn at icedtea.classpath.org Thu Jun 7 09:50:45 2012 From: adinn at icedtea.classpath.org (adinn at icedtea.classpath.org) Date: Thu, 07 Jun 2012 16:50:45 +0000 Subject: /hg/release/icedtea7-forest-2.1/hotspot: corrected call from fas... Message-ID: changeset 421a8b72633b in /hg/release/icedtea7-forest-2.1/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=421a8b72633b author: "Andrew Dinn " date: Thu Jun 07 17:49:46 2012 +0100 corrected call from fast_method_handle_entry to CppInterpreter::method_handle_entry so that thread is loaded into r2 diffstat: src/cpu/zero/vm/cppInterpreter_arm.S | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (11 lines): diff -r d11542907511 -r 421a8b72633b src/cpu/zero/vm/cppInterpreter_arm.S --- a/src/cpu/zero/vm/cppInterpreter_arm.S Thu May 31 06:42:18 2012 -0400 +++ b/src/cpu/zero/vm/cppInterpreter_arm.S Thu Jun 07 17:49:46 2012 +0100 @@ -2992,6 +2992,7 @@ ALIGN_CODE fast_method_handle_entry: stmfd arm_sp!, {regset, lr} + mov r2, thread bl _ZN14CppInterpreter19method_handle_entryEP13methodOopDesciP6Thread ldmia sp!, {regset, pc} From adinn at redhat.com Thu Jun 7 09:52:02 2012 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 07 Jun 2012 17:52:02 +0100 Subject: ARM : fix bug in indy code caused by the ARM JIT optimization patch In-Reply-To: <4FD08AB5.1020500@redhat.com> References: <4FD0638C.1080201@redhat.com> <4FD08AB5.1020500@redhat.com> Message-ID: <4FD0DC32.9060009@redhat.com> Ok, I have committed this patch and pushed it to the 7-2.1 repo. regards, Andrew Dinn ----------- On 07/06/12 12:04, Andrew Haley wrote: > On 06/07/2012 09:17 AM, Andrew Dinn wrote: >> The recent ARM JIT optimization patch (ed's big patch) reassigned the >> register holding the current Java thread. This inadvertently broke >> invokedynamic calls because the call to >> CppInterpreter::method_handle_entry from fast_method_handle_entry is >> relying upon the thread handle already being in argument register r2. A >> move from the thread register to r2 before making the call to method >> method_handle_entry fixes the problem. > > OK, thanks. > > Andrew. From aph at icedtea.classpath.org Thu Jun 7 09:54:17 2012 From: aph at icedtea.classpath.org (aph at icedtea.classpath.org) Date: Thu, 07 Jun 2012 16:54:17 +0000 Subject: /hg/release/icedtea7-forest-2.1/hotspot: 2 new changesets Message-ID: changeset 51380f2370a7 in /hg/release/icedtea7-forest-2.1/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=51380f2370a7 author: aph date: Wed Jun 06 10:09:22 2012 -0400 Fix JIT bug that miscompiles org.eclipse.ui.internal.contexts.ContextAuthority.sourceChanged 2012-06-06 Andrew Haley * thumb2.cpp (Thumb2_Compile): Ask the CompilerOracle if we should compile this method. (Thumb2_iOp): Use a temporary to hold the shift count. changeset 883fc064689b in /hg/release/icedtea7-forest-2.1/hotspot details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=883fc064689b author: aph date: Thu Jun 07 17:53:27 2012 +0100 merge diffstat: src/cpu/zero/vm/cppInterpreter_arm.S | 1 + src/cpu/zero/vm/thumb2.cpp | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diffs (57 lines): diff -r d11542907511 -r 883fc064689b src/cpu/zero/vm/cppInterpreter_arm.S --- a/src/cpu/zero/vm/cppInterpreter_arm.S Thu May 31 06:42:18 2012 -0400 +++ b/src/cpu/zero/vm/cppInterpreter_arm.S Thu Jun 07 17:53:27 2012 +0100 @@ -2992,6 +2992,7 @@ ALIGN_CODE fast_method_handle_entry: stmfd arm_sp!, {regset, lr} + mov r2, thread bl _ZN14CppInterpreter19method_handle_entryEP13methodOopDesciP6Thread ldmia sp!, {regset, pc} diff -r d11542907511 -r 883fc064689b src/cpu/zero/vm/thumb2.cpp --- a/src/cpu/zero/vm/thumb2.cpp Thu May 31 06:42:18 2012 -0400 +++ b/src/cpu/zero/vm/thumb2.cpp Thu Jun 07 17:53:27 2012 +0100 @@ -68,6 +68,7 @@ #include #include "precompiled.hpp" #include "interpreter/bytecodes.hpp" +#include "compiler/compilerOracle.hpp" #define opc_nop 0x00 #define opc_aconst_null 0x01 @@ -3969,8 +3970,12 @@ case opc_ishl: case opc_ishr: case opc_iushr: - and_imm(jinfo->codebuf, r_rho, r_rho, 31); - break; + { + unsigned tmp_reg = Thumb2_Tmp(jinfo, 1 << r_lho | 1 << r_rho | 1 << r); + and_imm(jinfo->codebuf, tmp_reg, r_rho, 31); + r_rho = tmp_reg; + break; + } } dop_reg(jinfo->codebuf, dOps[opc-opc_iadd], r, r_lho, r_rho, 0, 0); } @@ -7044,10 +7049,15 @@ if (!(CPUInfo & ARCH_THUMB2)) UseCompiler = false; - if (!UseCompiler || method->is_not_compilable()) { - ic->set(ic->state(), 1); - bc->set(ic->state(), 1); - return 0; + { + bool ignore; + methodHandle mh(thread, method); + if (!UseCompiler || method->is_not_compilable() + || CompilerOracle::should_exclude(mh, ignore)) { + ic->set(ic->state(), 1); + bc->set(ic->state(), 1); + return 0; + } } slow_entry = *(unsigned *)method->from_interpreted_entry(); From adinn at redhat.com Thu Jun 7 10:09:01 2012 From: adinn at redhat.com (Andrew Dinn) Date: Thu, 07 Jun 2012 18:09:01 +0100 Subject: RFC: Patch to enable adapter_opt_spread jsr 292 adapter code in zero In-Reply-To: <4FCF58DF.7090409@redhat.com> References: <4FCCA6EE.2030509@RedHat.Com> <4FCF58DF.7090409@redhat.com> Message-ID: <4FD0E02D.5040602@redhat.com> Hi Chris, I installed this patch and tested it on ARM. It failed initially but only because of a bug introduced by the recent optimization patch (ed's big patch). Once I fixed that I got the same result as you i.e. all but 13 of the 55 tests completed successfully on ARM. regards, Andrew Dinn ----------- On 06/06/12 14:19, Chris Phillips wrote: > Hi > Attached is an update to this patch with further fixes. > And the summary from current 64 bit testing is attached below below. > (I will build and run the sametest on arm later this am) > > On 04/06/12 08:15 AM, Chris Phillips wrote: >> Hi >> This patch provides support for jsr 292 in zero. >> It is against : >> http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot >> but will eventually apply to upstream also, ( after fixing other >> issues to >> allow testing). It enables a portion of jsr 292 logic that was not >> functional >> in the c++ Interpreter. It passes a large portion of the internal >> dynamic invoke test suite (test/java/lang/invoke) although there are >> still >> 4 failing tests and 10 "NYI" (mostly involving Ricochet frames). >> >> It has been vetted once in a slightly altered form internally but I would >> appreciate a few more eyes, would like to apply so qa testing can >> continue later today. >> >> Chris >> >> > Attached is an update to this patch with further fixes. > And the summary from current 64 bit testing is attached below below. > (I will build and run the same test on arm later this am, also will provide > patches and Makefile changes for testing with zero shortly.) > > Chris From adomurad at redhat.com Thu Jun 7 12:01:29 2012 From: adomurad at redhat.com (Adam Domurad) Date: Thu, 07 Jun 2012 15:01:29 -0400 Subject: [rfc][icedtea-web] finish to get rid of std out/err in testsuites In-Reply-To: <4FCCC34C.4040907@redhat.com> References: <4FCCC34C.4040907@redhat.com> Message-ID: <1339095689.24497.98.camel@voip-10-15-18-79.yyz.redhat.com> Sounds like a good idea. The information log lay out looks nice to me. (Small comment on logXXXReprint, although not part of this patch, the 'Reprint' idea was a bit unclear to me about what constituted the reprinting - my favour is to something like logXXXAndPrintln but take the suggestion as you will.) This patch seems to break some tests - eg ReadEnvironmentTest no longer seems to have the same contents of pr.stderr and thus fails, instead of containing the security related exception it has: netx: Launch Error: Could not launch JNLP file. ( ()) net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:600) at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:889) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) (etc...) Are you experiencing this as well ? Some minor comments (nitpicks if you will) inline. > diff -r f4f02e8c080d Makefile.am > --- a/Makefile.am Tue May 29 17:38:27 2012 +0200 > +++ b/Makefile.am Mon Jun 04 13:22:42 2012 +0200 > @@ -653,12 +653,11 @@ > class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ > CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):. \ > $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ > - -Xbootclasspath:$(RUNTIME) CommandLine $$class_names \ > - > stdout.log 2> stderr.log ; \ > - cat stdout.log ; \ > - cat stderr.log >&2 > + -Xbootclasspath:$(RUNTIME) CommandLine $$class_names > + > if WITH_XSLTPROC > - $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html > + $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(JNLP_TESTS_ENGINE_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html > + $(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html > endif > touch $@ > > @@ -807,12 +806,10 @@ > cd $(NETX_UNIT_TEST_DIR) ; \ > class_names=`cat $(UNIT_CLASS_NAMES)` ; \ > CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(JNLP_TESTS_ENGINE_DIR):. \ > - $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names \ > - > stdout.log 2> stderr.log ; \ > - cat stdout.log ; \ > - cat stderr.log >&2 > + $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names > if WITH_XSLTPROC > - $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html > + $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html > + $(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html > endif > touch $@ > > @@ -990,7 +987,7 @@ > > clean_tests_reports: > rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ > - rm -f $(TESTS_DIR)/index*.html > + rm -f $(TESTS_DIR)/*.html > > clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public > rm -f netx-dist-tests-source-files.txt > diff -r f4f02e8c080d tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java > --- a/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java Tue May 29 17:38:27 2012 +0200 > +++ b/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java Mon Jun 04 13:22:42 2012 +0200 > @@ -225,7 +225,7 @@ > try { > pr = server.executeJavawsHeadless(args, jnlp); > } catch (Exception ex) { > - ex.printStackTrace(); > + ServerAccess.logException(ex); > } finally { > finished = true; > } > diff -r f4f02e8c080d tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java > --- a/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java Tue May 29 17:38:27 2012 +0200 > +++ b/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java Mon Jun 04 13:22:42 2012 +0200 > @@ -64,12 +64,12 @@ > > for (int i = 0; i < simpleContent.length; i++) { > File file = simpleContent[i]; > - System.err.print(file.getName()); > + ServerAccess.logOutputReprint(file.getName()); > //server port have in fact no usage in converting filename to uri-like-filename. > //But if there is null, instead if some number, then nullpointer exception is thrown (Integer->int). > //So I'm using "real" currently used port, instead of some random value. > URI u = new URI((String)null,(String)null,(String)null,server.getPort(),file.getName(),(String)null,null); > - System.err.println(" ("+u.toString()+")"); > + ServerAccess.logOutputReprint(" ("+u.toString()+")"); > String fname=u.toString(); > if (file.getName().toLowerCase().endsWith(".jnlp")) { > String c = server.getResourceAsString("/" + fname); > @@ -98,13 +98,13 @@ > > @Override > public void charReaded(char ch) { > - //System.out.println("OO recieved char: "+ch); > + //ServerAccess.logOutputReprint(("OO recieved char: "+ch); Should be //ServerAccess.logOutputReprint("OO recieved char: "+ch); > o1.append(ch); > } > > @Override > public void lineReaded(String s) { > - //System.out.println("OO recieved line: "+s); > + //ServerAccess.logOutputReprint(("OO recieved line: "+s); Should be //ServerAccess.logOutputReprint("OO recieved line: "+s); > o2.append(s).append("\n"); > } > }; > @@ -112,22 +112,22 @@ > > @Override > public void charReaded(char ch) { > - //System.out.println("EE recieved char: "+ch); > + //ServerAccess.logOutputReprint(("EE recieved char: "+ch); Like above > e1.append(ch); > } > > @Override > public void lineReaded(String s) { > - //System.out.println("EE recieved line: "+s); > + //ServerAccess.logOutputReprint(("EE recieved line: "+s); Like above > e2.append(s).append("\n"); > } > }; > ServerAccess.ProcessResult pr=server.executeBrowser("simpletest1.jnlp",le,lo); > pr.process.destroy(); > -// System.out.println("total o"); > -// System.out.println(pr.stdout); > -// System.out.println("total e"); > -// System.out.println(pr.stderr); > +// ServerAccess.logOutputReprint(("total o"); > +// ServerAccess.logOutputReprint((pr.stdout); > +// ServerAccess.logOutputReprint(("total e"); > +// ServerAccess.logOutputReprint((pr.stderr); Last 4 lines like above (I suggest just looking for 'ServerAccess.logOutputReprint((') > Assert.assertEquals(pr.stdout, o1.toString()); > Assert.assertEquals(pr.stderr, e1.toString()); > //the last \n is mandatory as las tline is flushed also when proces dies > diff -r f4f02e8c080d tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java > --- a/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java Tue May 29 17:38:27 2012 +0200 > +++ b/tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java Mon Jun 04 13:22:42 2012 +0200 > @@ -42,12 +42,17 @@ > import java.io.DataOutputStream; > import java.io.File; > import java.io.FileInputStream; > +import java.io.FileNotFoundException; > +import java.io.FileOutputStream; > import java.io.FileWriter; > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStream; > +import java.io.OutputStreamWriter; > +import java.io.PrintWriter; > import java.io.Reader; > +import java.io.StringWriter; > import java.io.Writer; > import java.net.HttpURLConnection; > import java.net.MalformedURLException; > @@ -57,8 +62,13 @@ > import java.net.URL; > import java.net.URLDecoder; > import java.util.ArrayList; > +import java.util.Date; > +import java.util.HashMap; > import java.util.HashSet; > +import java.util.LinkedList; > import java.util.List; > +import java.util.Map; > +import java.util.Map.Entry; > import java.util.Set; > import java.util.StringTokenizer; > import org.junit.Assert; > @@ -120,8 +130,166 @@ > * this flag is indicating whether output of executeProcess should be logged. By default true. > */ > public static boolean PROCESS_LOG = true; > + public static boolean LOGS_REPRINT = false; > > /** > + * map of classes, each have map of methods, each have errorlist, outLIst, and allList (allist contains also not std or err messages) > + * class.testMethod.logs > + */ > + private static final Map> processLogs = new HashMap>(100); > + private static final File DEFAULT_LOG_FILE = new File("ServerAccess-logs.xml"); > + private static final File DEFAULT_STDERR_FILE = new File("stderr.log"); > + private static final File DEFAULT_STDOUT_FILE = new File("stdout.log"); > + private static final File DEFAULT_STDLOGS_FILE = new File("all.log"); > + private static BufferedWriter DEFAULT_STDERR_WRITER; > + private static BufferedWriter DEFAULT_STDOUT_WRITER; > + private static BufferedWriter DEFAULT_STDLOGS_WRITER; > + > + static{ > + try{ > + DEFAULT_STDOUT_WRITER=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDOUT_FILE))); > + DEFAULT_STDERR_WRITER=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDERR_FILE))); > + DEFAULT_STDLOGS_WRITER=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDLOGS_FILE))); > + }catch(Throwable t){ > + t.printStackTrace(); > + } > + } > + private static final String LOGS_ELEMENT = "logs"; > + private static final String CLASSLOG_ELEMENT = "classlog"; > + private static final String CLASSNAME_ATTRIBUTE = "className"; > + private static final String TESTLOG_ELEMENT = "testLog"; > + private static final String TESTMETHOD_ATTRIBUTE = "testMethod"; > + private static final String FULLID_ATTRIBUTE = "fullId"; > + private static final String LOG_ELEMENT = "log"; > + private static final String LOG_ID_ATTRIBUTE = "id"; > + private static final String ITEM_ELEMENT = "item"; > + private static final String ITEM_ID_ATTRIBUTE = "id"; > + private static final String STAMP_ELEMENT = "stamp"; > + private static final String TEXT_ELEMENT = "text"; > + private static final String FULLTRACE_ELEMENT = "fulltrace"; > + > + private static void writeXmlLog() throws FileNotFoundException, IOException { > + writeXmlLog(DEFAULT_LOG_FILE); > + } > + > + private static void writeXmlLog(File f) throws FileNotFoundException, IOException { > + Writer w = new OutputStreamWriter(new FileOutputStream(f)); Maybe buffer-wrap this with a BufferedWriter ? Not too sure though. > + Set>> classes = processLogs.entrySet(); > + w.write("<" + LOGS_ELEMENT + ">"); > + for (Entry> classLog : classes) { > + String className = classLog.getKey(); > + w.write("<" + CLASSLOG_ELEMENT + " " + CLASSNAME_ATTRIBUTE + "=\"" + className + "\">"); > + Set> testsLogs = classLog.getValue().entrySet(); > + for (Entry testLog : testsLogs) { > + String testName = testLog.getKey(); > + String testLogs = testLog.getValue().toString(); > + w.write("<" + TESTLOG_ELEMENT + " " + TESTMETHOD_ATTRIBUTE + "=\"" + testName + "\" " + FULLID_ATTRIBUTE + "=\"" + className + "." + testName + "\" >"); > + w.write(testLogs); > + w.write(""); > + } > + w.write(""); > + } > + w.write(""); > + w.flush(); > + w.close(); > + } > + > + private static void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) { > + Map classLog = processLogs.get(ste.getClassName()); > + if (classLog == null) { > + classLog = new HashMap(50); > + processLogs.put(ste.getClassName(), classLog); > + } > + TestsLogs methodLog = classLog.get(ste.getMethodName()); > + if (methodLog == null) { > + methodLog = new TestsLogs(); > + classLog.put(ste.getMethodName(), methodLog); > + } > + methodLog.add(printToErr, printToOut, message); > + } > + > + private static class TestsLogs { > + > + public final List outs = new LinkedList(); > + public final List errs = new LinkedList(); > + public final List all = new LinkedList(); > + private static boolean added = false; > + > + public synchronized void add(boolean err, boolean out, String text) { > + if (text == null) { > + text = "null"; > + } > + LogItem li = new LogItem(text); > + if (out) { > + outs.add(li); > + } > + if (err) { > + errs.add(li); > + } > + all.add(li); > + if (!added) { > + Runtime.getRuntime().addShutdownHook(new Thread() { > + > + @Override > + public void run() { > + try { > + writeXmlLog(); > + } catch (Exception ex) { > + ex.printStackTrace(); > + } > + } > + }); > + added = true; > + } > + } > + > + @Override > + public String toString() { > + StringBuilder sb = listToString(outs, "out"); > + sb.append(listToString(errs, "err")); > + sb.append(listToString(all, "all")); > + return sb.toString(); > + } > + > + private StringBuilder listToString(List l, String id) { Nitpick, this is really listToStringBuilder :). > + StringBuilder sb = new StringBuilder(); > + sb.append("<" + LOG_ELEMENT + " " + LOG_ID_ATTRIBUTE + "=\"").append(id).append("\">\n"); > + int i = 0; > + for (LogItem logItem : l) { > + i++; > + sb.append(logItem.toString(i)); > + } > + sb.append("\n"); > + return sb; > + } > + }; > + > + private static class LogItem { > + > + public final Date timeStamp = new Date(); > + public final StackTraceElement[] fullTrace = Thread.currentThread().getStackTrace(); > + public final String text; > + > + public LogItem(String text) { > + this.text = text; > + } > + > + public StringBuilder toString(int id) { This returns a StringBuilder unlike its name suggests :) > + StringBuilder sb = new StringBuilder(); > + sb.append(" <" + ITEM_ELEMENT + " " + ITEM_ID_ATTRIBUTE + "=\"").append(id).append("\">\n"); > + sb.append(" <" + STAMP_ELEMENT + ">\n"); > + sb.append(" <" + TEXT_ELEMENT + ">\n"); > + sb.append(" <" + FULLTRACE_ELEMENT + "> + //five methods since call in log methods + getStacktrace method > + for (int i = 6; i < fullTrace.length; i++) { > + sb.append(fullTrace[i].toString()).append("\n"); > + } > + sb.append("\n]]> \n"); > + sb.append(" \n"); > + return sb; > + } > + } > + /** > * main method of this class prints out random free port > * or runs server > * param "port" prints out the port > @@ -562,7 +730,10 @@ > * @throws IOException > */ > public static void saveFile(String content, File f) throws IOException { > - Writer output = new BufferedWriter(new FileWriter(f)); > + saveFile(content, f, "utf-8"); > + } > + public static void saveFile(String content, File f,String encoding) throws IOException { > + Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f),encoding)); > output.write(content); > output.flush(); > output.close(); > @@ -762,11 +933,45 @@ > idded = fullId + ": " + message; > > } > + if (LOGS_REPRINT) { > + if (printToOut) { > + System.out.println(idded); > + } > + if (printToErr) { > + System.err.println(idded); > + } > + } > + try{ > if (printToOut) { > - System.out.println(idded); > + DEFAULT_STDOUT_WRITER.write(idded); > + DEFAULT_STDOUT_WRITER.newLine(); > } > if (printToErr) { > - System.err.println(idded); > + DEFAULT_STDERR_WRITER.write(idded); > + DEFAULT_STDERR_WRITER.newLine(); > + } > + DEFAULT_STDLOGS_WRITER.write(idded); > + DEFAULT_STDLOGS_WRITER.newLine(); > + }catch (Throwable t){ > + t.printStackTrace(); > + } > + > + addToXmlLog(message,printToOut,printToErr,ste); > + } > + > + public static void logException(Throwable t){ > + logException(t, true); > + } > + public static void logException(Throwable t, boolean print){ > + try{ > + StringWriter sw = new StringWriter(); > + PrintWriter pw = new PrintWriter(sw); > + t.printStackTrace(pw); > + log(sw.toString(), false, print); > + pw.close(); > + sw.close(); > + }catch(Exception ex){ > + throw new RuntimeException(ex); > } > } > > @@ -789,6 +994,12 @@ > break; > } > } > + //if nothing left in stack then we have been in ServerAccess already > + //so the target method is the highest form it and better to return it > + //rather then die to ArrayOutOfBounds > + if(i >= stack.length){ > + return result; > + } > //now we are out of net.sourceforge.jnlp.ServerAccess > //method we need (the test) is highest from following class > baseClass = stack[i].getClassName(); > @@ -1073,9 +1284,9 @@ > String op = t.nextToken(); > String p = op; > if (p.startsWith(XSX))p=p.replace(XSX, "/"); > - System.err.println("Getting: "+p); > + logNoReprint("Getting: "+p); > p=URLDecoder.decode(p, "UTF-8"); > - System.err.println("Serving: "+p); > + logNoReprint("Serving: "+p); > p = (".".concat(((p.endsWith("/")) ? p.concat( > "index.html") : p))).replace('/', File.separatorChar); > File pp = new File(dir, p); > @@ -1107,14 +1318,14 @@ > } > } > }catch (SocketException e) { > - e.printStackTrace(); > + logException(e, false); > } catch (Exception e) { > o.writeBytes("HTTP/1.0 404 ERROR\n\n\n"); > - e.printStackTrace(); > + logException(e, false); > } > o.close(); > } catch (Exception e) { > - e.printStackTrace(); > + logException(e, false); > } > } > } > @@ -1248,14 +1459,13 @@ > this.canRun = canRun; > if (p != null) { > if (p.getP() != null) { > - System.err.println("Stopping assassin for" + p.toString() + " " + p.getP().toString() + " " + p.getCommandLine() + ": "); > + logNoReprint("Stopping assassin for" + p.toString() + " " + p.getP().toString() + " " + p.getCommandLine() + ": "); > } else { > - System.err.println("Stopping assassin for" + p.toString() + " " + p.getCommandLine() + ": "); > + logNoReprint("Stopping assassin for" + p.toString() + " " + p.getCommandLine() + ": "); > } > } else { > - System.err.println("Stopping assassin for null job: "); > + logNoReprint("Stopping assassin for null job: "); > } > - System.err.flush(); > } > > public boolean isCanRun() { > @@ -1288,11 +1498,10 @@ > try { > if (p != null) { > if (p.getP() != null) { > - System.err.println("Timed out " + p.toString() + " " + p.getP().toString() + " .. killing " + p.getCommandLine() + ": "); > + logErrorReprint("Timed out " + p.toString() + " " + p.getP().toString() + " .. killing " + p.getCommandLine() + ": "); > } else { > - System.err.println("Timed out " + p.toString() + " " + "null .. killing " + p.getCommandLine() + ": "); > + logErrorReprint("Timed out " + p.toString() + " " + "null .. killing " + p.getCommandLine() + ": "); > } > - System.err.flush(); > wasTerminated = true; > p.interrupt(); > while (!terminated.contains(p)) { > @@ -1311,13 +1520,12 @@ > } > } > if (p.getP() != null) { > - System.err.println("Timed out " + p.toString() + " " + p.getP().toString() + " .. killed " + p.getCommandLine()); > + logErrorReprint("Timed out " + p.toString() + " " + p.getP().toString() + " .. killed " + p.getCommandLine()); > } else { > - System.err.println("Timed out " + p.toString() + " null .. killed " + p.getCommandLine()); > + logErrorReprint("Timed out " + p.toString() + " null .. killed " + p.getCommandLine()); > } > - System.err.flush(); > } else { > - System.err.println("Timed out null job"); > + logErrorReprint("Timed out null job"); > } > break; > } finally { > @@ -1333,14 +1541,13 @@ > } > if (p != null) { > if (p.getP() != null) { > - System.err.println("assassin for" + p.toString() + " " + p.getP().toString() + " .. done " + p.getCommandLine() + " termination " + wasTerminated); > + logNoReprint("assassin for" + p.toString() + " " + p.getP().toString() + " .. done " + p.getCommandLine() + " termination " + wasTerminated); > } else { > - System.err.println("assassin for" + p.toString() + " null .. done " + p.getCommandLine() + " termination " + wasTerminated); > + logNoReprint("assassin for" + p.toString() + " null .. done " + p.getCommandLine() + " termination " + wasTerminated); > } > } else { > - System.err.println("assassin for non exisitng job termination " + wasTerminated); > + logNoReprint("assassin for non exisitng job termination " + wasTerminated); exisitng -> existing > } > - System.err.flush(); > } > } > > @@ -1418,8 +1625,8 @@ > } > > if (interrupted) { > - System.out.println("Stream copier: throwing InterruptedException"); > - //throw new InterruptedException(); > + logNoReprint("Stream copier: throwing InterruptedException"); > + //throw new InteSystemrruptedException(); ^ Artifact in comment :) > } > } > > diff -r f4f02e8c080d tests/report-styles/index.js > --- a/tests/report-styles/index.js Tue May 29 17:38:27 2012 +0200 > +++ b/tests/report-styles/index.js Mon Jun 04 13:22:42 2012 +0200 > @@ -1,3 +1,20 @@ > +function showhideMethods(inElement,toValue) { > + var e = document.getElementById(inElement); > + methods=e.getElementsByClassName("method"); > + for ( var i = 0; i < methods.length; i++ ) { > + methods[i].style.display=toValue > + } > +} > +function openAnchor() { > + anchor=self.document.location.hash; > + if (anchor==null || anchor=="") return; > + stub=anchor.substring(1); > + var logs=getLogsArray(stub); > + logs[0].style.display="inline"; > + logs[1].style.display="inline"; > + recalcArraysWidth(logs); > + window.location.hash=stub; > +} > > function negateIdDisplay(which) { > var e = document.getElementById(which); > @@ -8,6 +25,14 @@ > } > } > > +function negateIdDisplayInline(which) { > + var e = document.getElementById(which); > + if (e.style.display=="inline") { > + e.style.display="none" > + } else { > + e.style.display="inline" > + } > +} > > function setClassDisplay(which,what) { > var e = document.getElementsByClassName(which); > @@ -16,5 +41,62 @@ > } > } > > +function negateClassBlocDisplay(which) { > + var e = document.getElementsByClassName(which); > + for ( var i = 0; i < e.length; i++ ) { > + if (e[i].style.display=="block") { > + e[i].style.display="none" > + } else { > + e[i].style.display="block" > + } > + } > +} > > +function negateClassBlocDisplayIn(where,which) { > + var parent = document.getElementById(where); > + var e = parent.getElementsByClassName(which); > + for ( var i = 0; i < e.length; i++ ) { > + if (e[i].style.display=="block") { > + e[i].style.display="none" > + } else { > + e[i].style.display="block" > + } > + } > +} > > +function getLogsArray(stub) { > + return new Array(document.getElementById(stub+".out"),document.getElementById(stub+".err"),document.getElementById(stub+".all")); > +} > + > +function recalcLogsWidth(stub) { > + var logs=getLogsArray(stub) > + recalcArraysWidth(logs); > +} > +function showAllLogs() { > + var e = document.getElementsByClassName("method"); > + for ( var i = 0; i < e.length; i++ ) { > + stub=e[i].id; > + var logs=getLogsArray(stub) > + logs[0].style.display="none"; > + logs[1].style.display="none" > + logs[2].style.display="inline" > + recalcArraysWidth(logs); > + > + } > +} > + > +function recalcArraysWidth(logs) { > + visible=0; > + for ( var i = 0; i < logs.length; i++ ) { > + if (logs[i].style.display!="none"){ > + visible++; > + } > + } > + if (visible==0) return; > + nwWidth=90/visible; > + for ( var i = 0; i < logs.length; i++ ) { > + if (logs[i].style.display!="none"){ > + logs[i].style.width=nwWidth+"%"; > + } > + } > +} > diff -r f4f02e8c080d tests/report-styles/jreport.xsl > --- a/tests/report-styles/jreport.xsl Tue May 29 17:38:27 2012 +0200 > +++ b/tests/report-styles/jreport.xsl Mon Jun 04 13:22:42 2012 +0200 > @@ -38,6 +38,14 @@ > --> > > > + > > > > @@ -167,8 +175,20 @@ > >
>
> - > -
> + > + > + > + > + #. > + > + > + > + > + > + > + > + > +
> - >
> > diff -r f4f02e8c080d tests/report-styles/logs.xsl > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/tests/report-styles/logs.xsl Mon Jun 04 13:22:42 2012 +0200 > @@ -0,0 +1,153 @@ > + > + > + > + > + > + > + > +