diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/scripts | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/scripts')
24 files changed, 3476 insertions, 8 deletions
diff --git a/libjava/classpath/scripts/.cvsignore b/libjava/classpath/scripts/.cvsignore new file mode 100644 index 00000000000..190036bb1ae --- /dev/null +++ b/libjava/classpath/scripts/.cvsignore @@ -0,0 +1,3 @@ +Makefile +Makefile.in +classpath.spec diff --git a/libjava/classpath/scripts/Makefile.in b/libjava/classpath/scripts/Makefile.in index 2c4ff902149..d8ad93bb7f9 100644 --- a/libjava/classpath/scripts/Makefile.in +++ b/libjava/classpath/scripts/Makefile.in @@ -42,12 +42,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ $(top_srcdir)/../../config/lead-dot.m4 \ + $(top_srcdir)/../../config/no-executables.m4 \ $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ax_create_stdint_h.m4 \ - $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -158,6 +160,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@ +JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@ +JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ @@ -279,7 +283,6 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -toolexeclibdir = @toolexeclibdir@ vm_classes = @vm_classes@ EXTRA_DIST = check_jni_methods.sh generate-locale-list.sh import-cacerts.sh all: all-am diff --git a/libjava/classpath/scripts/build_mathnamespace b/libjava/classpath/scripts/build_mathnamespace new file mode 100644 index 00000000000..a2e53a3284d --- /dev/null +++ b/libjava/classpath/scripts/build_mathnamespace @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "/* Warning ! This is a generated file. Use build_mathnamespace to regenerate it */" +while read fun;do + echo "#define ${fun} ClasspathMath_${fun}" +done diff --git a/libjava/classpath/scripts/check_jni_methods.sh b/libjava/classpath/scripts/check_jni_methods.sh index 4cc00cc17f3..b46e378214e 100755 --- a/libjava/classpath/scripts/check_jni_methods.sh +++ b/libjava/classpath/scripts/check_jni_methods.sh @@ -35,9 +35,6 @@ cat > $TMPFILE3 << EOF -Java_gnu_java_awt_peer_gtk_GtkMenuComponentPeer_dispose -Java_java_lang_VMSystem_arraycopy -Java_java_lang_VMSystem_identityHashCode --Java_gnu_java_util_prefs_gconf_GConfNativePeer_finalize_1class --Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1id_1cache --Java_gnu_java_util_prefs_gconf_GConfNativePeer_init_1class EOF # Compare again silently. diff --git a/libjava/classpath/scripts/checkstyle-config.xml b/libjava/classpath/scripts/checkstyle-config.xml new file mode 100644 index 00000000000..498e7faddd3 --- /dev/null +++ b/libjava/classpath/scripts/checkstyle-config.xml @@ -0,0 +1,132 @@ +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.2//EN" + "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> +<!-- + +Changes to this file need to be discussed on classpath@gnu.org +mailing list first and probably documented in the hacking guide. + +--> +<module name="Checker"> + <module name="PackageHtml"/> + + <module name="TreeWalker"> + <property name="tabWidth" value="8"/> + + <!-- Javadoc related checks --> + <!-- + <module name="JavadocType"> + <property name="scope" value="protected"/> + </module> + <module name="JavadocMethod"> + <property name="scope" value="protected"/> + <property name="allowUndeclaredRTE" value="true"/> + </module> + <module name="JavadocVariable"> + <property name="scope" value="protected"/> + </module> + --> + <module name="JavadocStyle"> + <property name="checkFirstSentence" value="false"/> + <property name="checkHtml" value="true"/> + </module> + + <!-- File header checks --> + <module name="RegexpHeader"> + <property name="headerFile" value="scripts/checkstyle-header.regex"/> + <property name="multiLines" value="2, 3, 38"/> + </module> + + <!-- import checks --> + <module name="AvoidStarImport"/> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + <module name="ImportOrder"> + <property name="groups" value="gnu,java,javax,org"/> + <property name="ordered" value="true"/> + <property name="separated" value="true"/> + </module> + + <!-- size checks --> + <!-- + <module name="LineLength"> + <property name="max" value="80"/> + </module> + --> + + <!-- modifier checks --> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + + <!-- block checks --> + <!-- + <module name="EmptyBlock"> + <property name="option" value="text"/> + </module> + <module name="LeftCurly"> + <property name="option" value="nl"/> + </module> + <module name="RightCurly"> + <property name="option" value="alone"/> + </module> + <module name="AvoidNestedBlocks"/> + --> + + <!-- coding problem checks --> + <!-- + <module name="ArrayTrailingComma"/> + <module name="CovariantEquals"/> + <module name="DoubleCheckedLocking"/> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="HiddenField"/> + --> + <module name="IllegalInstantiation"> + <property name="classes" value="java.lang.Boolean"/> + </module> + <!-- + <module name="InnerAssignment"/> + <module name="MagicNumber"/> + <module name="RedundantThrows"/> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + <module name="NestedIfDepth"/> + <module name="NestedTryDepth"/> + <module name="SuperClone"/> + <module name="SuperFinalize"/> + <module name="IllegalCatch"/> + --> + <module name="PackageDeclaration"/> + <!-- + <module name="DeclarationOrder"/> + <module name="DefaultComesLast"/> + <module name="UnnecessaryParentheses"/> + --> + + <!-- design problem checks --> + <!-- + <module name="FinalClass"/> + <module name="HideUtilityClassConstructor"/> + --> + + <!-- miscellaneous checks --> + <!-- + <module name="TodoComment"/> + <module name="UpperEll"/> + <module name="ArrayTypeStyle"/> + <module name="Indentation"> + <property name="basicOffset" value="2"/> + <property name="braceAdjustment" value="2"/> + <property name="caseIndent" value="0"/> + </module> + --> + </module> + <!-- + <module name="StrictDuplicateCode"/> + --> + + <module name="SuppressionFilter"> + <property name="file" value="scripts/checkstyle-suppressions.xml"/> + </module> +</module> diff --git a/libjava/classpath/scripts/checkstyle-header.regex b/libjava/classpath/scripts/checkstyle-header.regex new file mode 100644 index 00000000000..15eb29a5092 --- /dev/null +++ b/libjava/classpath/scripts/checkstyle-header.regex @@ -0,0 +1,38 @@ +^/\* .*$ +^ .*$ +^ (Copyright \(C\) .*|Free Software Foundation, Inc.)$ +^$ +^This file is part of GNU Classpath.$ +^$ +^GNU Classpath is free software; you can redistribute it and/or modify$ +^it under the terms of the GNU General Public License as published by$ +^the Free Software Foundation; either version 2, or \(at your option\)$ +^any later version.$ +^ *$ +^GNU Classpath is distributed in the hope that it will be useful, but$ +^WITHOUT ANY WARRANTY; without even the implied warranty of$ +^MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU$ +^General Public License for more details.$ +^$ +^You should have received a copy of the GNU General Public License$ +^along with GNU Classpath; see the file COPYING. If not, write to the$ +^Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA$ +^02110-1301 USA.$ +^$ +^Linking this library statically or dynamically with other modules is$ +^making a combined work based on this library. Thus, the terms and$ +^conditions of the GNU General Public License cover the whole$ +^combination.$ +^$ +^As a special exception, the copyright holders of this library give you$ +^permission to link this library with independent modules to produce an$ +^executable, regardless of the license terms of these independent$ +^modules, and to copy and distribute the resulting executable under$ +^terms of your choice, provided that you also meet, for each linked$ +^independent module, the terms and conditions of the license of that$ +^module. An independent module is a module which is not derived from$ +^or based on this library. If you modify this library, you may extend$ +^this exception to your version of the library, but you are not$ +^obligated to do so. If you do not wish to do so, delete this$ +^exception statement from your version. \*/$ +^ *$ diff --git a/libjava/classpath/scripts/checkstyle-suppressions.xml b/libjava/classpath/scripts/checkstyle-suppressions.xml new file mode 100644 index 00000000000..68c620ce958 --- /dev/null +++ b/libjava/classpath/scripts/checkstyle-suppressions.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!DOCTYPE suppressions PUBLIC + "-//Puppy Crawl//DTD Suppressions 1.0//EN" + "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> +<!-- + +Changes to this file need to be discussed on classpath@gnu.org +mailing list first and probably documented in the hacking guide. + +--> +<suppressions> + <suppress checks="AvoidStarImport" + files="gnu/java/awt/peer/gtk/GtkToolkit.java" + lines="48,59"/> + <suppress checks="IllegalInstantiation" + files="java/lang/Boolean.java" + lines="65,73"/> + <suppress checks="IllegalInstantiation" + files="java/util/logging/LogManager.java" + lines="674"/> + <suppress checks="RegexpHeader" + files="javax/rmi/CORBA/SystemException.java" + lines="1"/> + <suppress checks="RegexpHeader" + files="javax/rmi/CORBA/ObjectImpl.java" + lines="1"/> + <suppress checks="RegexpHeader" + files="javax/rmi/ORB.java" + lines="1"/> + <suppress checks="RegexpHeader" + files="javax/rmi/BAD_OPERATION.java" + lines="1"/> +</suppressions> + diff --git a/libjava/classpath/scripts/checkstyle.css b/libjava/classpath/scripts/checkstyle.css new file mode 100644 index 00000000000..9d1fd8b7460 --- /dev/null +++ b/libjava/classpath/scripts/checkstyle.css @@ -0,0 +1,42 @@ +body { + color: black; + font-family: sans-serif; +} +h1 { + color: #990000; + border-width: 1px; + border-style: solid; + border-color: black; + padding: 0.2em; + background-color: #cccccc; + width: 100%; +} +h2 { + color: #990000; + border-width: 1px; + border-style: solid; + border-color: black; + padding: 0.2em; + background-color: #cccccc; + width: 100%; +} +h3 { + color: #990000; + border-width: 1px; + border-style: solid; + border-color: black; + padding: 0.2em; + background-color: #cccccc; + width: 100%; +} +table { + width: 100%; +} +th { + color: white; + background-color: #999999; + text-align: left; +} +td { + background-color: #cccccc; +} diff --git a/libjava/classpath/scripts/checkstyle2html.xsl b/libjava/classpath/scripts/checkstyle2html.xsl new file mode 100644 index 00000000000..89639876ad6 --- /dev/null +++ b/libjava/classpath/scripts/checkstyle2html.xsl @@ -0,0 +1,102 @@ +<?xml version='1.0'?> +<!-- XSL stylesheet to convert checkstyle XML to HTML --> +<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + + <!-- This tells the XSLT processor to emit HTML --> + <xsl:output method='html' + doctype-public='-//W3C//DTD HTML 4.01//EN' + doctype-system='http://www.w3.org/TR/html4/strict.dtd' + omit-xml-declaration='yes'/> + + <!-- Match the checkstyle root element --> + <xsl:template match='checkstyle'> + <html> + <head> + <title>Checkstyle results</title> + <link rel='stylesheet' type='text/css' href='checkstyle.css' /> + </head> + <body> + <h1>Checkstyle results</h1> + <div>The following document contains the results of + <a href='http://checkstyle.sourceforge.net/'>Checkstyle</a>.</div> + + <h2>Summary</h2> + <table summary='Summary'> + <tr> + <th>Files</th><th>Infos</th><th>Warnings</th><th>Errors</th> + </tr> + <tr> + <td><xsl:value-of select='count(file)' /></td> + <td><xsl:value-of select='count(file/error[@severity="info"])' /></td> + <td><xsl:value-of select='count(file/error[@severity="warning"])' /></td> + <td><xsl:value-of select='count(file/error[@severity="error"])' /></td> + </tr> + </table> + + <h2>Files</h2> + <table summary='Files'> + <tr> + <th>File</th><th>I</th><th>W</th><th>E</th> + </tr> + <!-- Process file elements in file mode --> + <xsl:apply-templates select='file' mode='file'> + <xsl:sort select="@name"/> + </xsl:apply-templates> + </table> + + <!-- Process file elements in detail mode --> + <xsl:apply-templates select='file' mode='detail'> + <xsl:sort select="@name"/> + </xsl:apply-templates> + </body> + </html> + </xsl:template> + + <!-- Match a file element in file mode --> + <xsl:template match='file' mode='file'> + <xsl:if test='count(error) > 0'> + <tr> + <td> + <xsl:element name='a'> + <xsl:attribute name='href'> + #<xsl:value-of select='translate(string(@name),"/","__")' /> + </xsl:attribute> + <xsl:value-of select='@name' /> + </xsl:element> + </td> + <td><xsl:value-of select='count(error[@severity="info"])' /></td> + <td><xsl:value-of select='count(error[@severity="warning"])' /></td> + <td><xsl:value-of select='count(error[@severity="error"])' /></td> + </tr> + </xsl:if> + </xsl:template> + + <!-- Match a file element in detail mode--> + <xsl:template match='file' mode='detail'> + <xsl:if test='count(error) > 0'> + <h3> + <xsl:element name='a'> + <xsl:attribute name='name'> + <xsl:value-of select='translate(string(@name),"/","__")' /> + </xsl:attribute> + <xsl:value-of select='@name' /> + </xsl:element> + </h3> + <table summary='Errors'> + <tr> + <th>Error</th><th width="100px">Line</th> + </tr> + <xsl:apply-templates select='error' /> + </table> + </xsl:if> + </xsl:template> + + <!-- Match an error element --> + <xsl:template match='error'> + <tr> + <td><xsl:value-of select='@message'/></td> + <td><xsl:value-of select='@line' /></td> + </tr> + </xsl:template> + +</xsl:stylesheet> diff --git a/libjava/classpath/scripts/classpath-build b/libjava/classpath/scripts/classpath-build new file mode 100755 index 00000000000..cd0e7d63e24 --- /dev/null +++ b/libjava/classpath/scripts/classpath-build @@ -0,0 +1,68 @@ +#!/bin/sh + +# cvs may timeout ... +set -e + +export CVS_RSH=ssh + +CLASSPATH_CVSSRCDIR=$HOME/src/cvs/classpath +CLASSPATH_SRCDIR=$HOME/src/classpath +CLASSPATH_BUILDDIR=$HOME/src/classpath/build + +DATE=`date +"%Y%m%d"` +OUTPUTDIR=$HOME/public_html/classpath/daily +LOGFILE=$OUTPUTDIR/classpath-$DATE.log + +echo -n > $LOGFILE + +if [ -d $CLASSPATH_CVSSRCDIR ] ; then + echo "update cvs source tree" >> $LOGFILE + cd $CLASSPATH_CVSSRCDIR + cvs -z 3 update >> $LOGFILE 2>&1 +fi + +if [ -d $CLASSPATH_SRCDIR ] ; then + + # delete old sources + echo "delete old source tree" >> $LOGFILE + + # workaround for automake safety behaviour with umask + chmod u+w -R $CLASSPATH_SRCDIR + + rm -rf $CLASSPATH_SRCDIR + +fi + +echo "copy cvs tree to source tree" >> $LOGFILE +cp -a $CLASSPATH_CVSSRCDIR $CLASSPATH_SRCDIR +cd $CLASSPATH_SRCDIR + +# patch version in configure.ac +if [ -f configure.ac ] ; then + mv configure.ac configure.ac.orig + sed "s/, \[.*cvs\]/, [$DATE]/" < configure.ac.orig > configure.ac +fi + +# generate autofriends stuff +./autogen.sh >> $LOGFILE 2>&1 + +# create build directory +mkdir build +cd build + +# configure and build classpath +export LD_LIBRARY_PATH=/usr/local/lib +../configure --prefix=$HOME/local/classpath --with-jikes=/usr/bin/jikes --enable-glibj=both --enable-jni --enable-gtk-peer --enable-regen-headers >> $LOGFILE 2>&1 +make >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +make dist >> $LOGFILE 2>&1 +#make distcheck >> $LOGFILE 2>&1 +cp classpath-$DATE.tar.gz $OUTPUTDIR + +cd $OUTPUTDIR +ln -sf classpath-$DATE.tar.gz LATEST-SNAPSHOT +ln -sf classpath-$DATE.log LATEST-BUILDLOG + +exit 0 + diff --git a/libjava/classpath/scripts/classpath-daily b/libjava/classpath/scripts/classpath-daily new file mode 100755 index 00000000000..c7405277346 --- /dev/null +++ b/libjava/classpath/scripts/classpath-daily @@ -0,0 +1,17 @@ +#!/bin/sh + +DATE=`date +"%Y%m%d"` +OUTPUTDIR=$HOME/public_html/classpath/daily +LOGFILE=$OUTPUTDIR/classpath-$DATE.log +FAILEDLOG=$OUTPUTDIR/classpath-failed-$DATE.log +MAIL="konqueror@gmx.de" + +/home/mkoch/bin/classpath-build + +if test "$?" = "1" ; then + tail --lines=100 $LOGFILE > $FAILEDLOG + + mail $MAIL -s "classpath daily snapshot $DATE FAILED" < $FAILEDLOG +else + mail $MAIL -s "classpath daily snapshot $DATE SUCCESSFUL" < /dev/null > /dev/null +fi diff --git a/libjava/classpath/scripts/classpath.spec.in b/libjava/classpath/scripts/classpath.spec.in index 80522748d6e..4120d25507c 100644 --- a/libjava/classpath/scripts/classpath.spec.in +++ b/libjava/classpath/scripts/classpath.spec.in @@ -1,4 +1,4 @@ -# $Id: classpath.spec.in,v 1.2 2005/07/04 14:31:01 ziga Exp $ +# $Id: classpath.spec.in,v 1.3 2006/12/10 20:25:50 gnu_andrew Exp $ %define version_num @PACKAGE_VERSION@ %define release_num 1 diff --git a/libjava/classpath/scripts/eclipse-gnu.xml b/libjava/classpath/scripts/eclipse-gnu.xml new file mode 100644 index 00000000000..60a1082ca1e --- /dev/null +++ b/libjava/classpath/scripts/eclipse-gnu.xml @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="UTF-8"?> +<profiles version="8"> +<profile name="GNU" version="8"> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="82"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="17"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="17"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_shifted"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_shifted"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +</profile> +</profiles> diff --git a/libjava/classpath/scripts/jalopy-gnu.xml b/libjava/classpath/scripts/jalopy-gnu.xml new file mode 100644 index 00000000000..ad5c5abdffe --- /dev/null +++ b/libjava/classpath/scripts/jalopy-gnu.xml @@ -0,0 +1,378 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jalopy> + <general> + <compliance> + <version>14</version> + </compliance> + <style> + <description>GNU Java Coding Convention</description> + <name>GNU</name> + </style> + </general> + <inspector> + <enable>false</enable> + <naming> + <classes> + <abstract>[A-Z][a-zA-Z0-9]+</abstract> + <general>[A-Z][a-zA-Z0-9]+</general> + </classes> + <fields> + <default>[a-z][\w]+</default> + <defaultStatic>[a-z][\w]+</defaultStatic> + <defaultStaticFinal>[a-zA-Z][\w]+</defaultStaticFinal> + <private>[a-z][\w]+</private> + <privateStatic>[a-z][\w]+</privateStatic> + <privateStaticFinal>[a-zA-Z][\w]+</privateStaticFinal> + <protected>[a-z][\w]+</protected> + <protectedStatic>[a-z][\w]+</protectedStatic> + <protectedStaticFinal>[a-zA-Z][\w]+</protectedStaticFinal> + <public>[a-z][\w]+</public> + <publicStatic>[a-z][\w]+</publicStatic> + <publicStaticFinal>[a-zA-Z][\w]+</publicStaticFinal> + </fields> + <interfaces>[A-Z][a-zA-Z0-9]+</interfaces> + <labels>\w+</labels> + <methods> + <default>[a-z][\w]+</default> + <defaultStatic>[a-z][\w]+</defaultStatic> + <defaultStaticFinal>[a-z][\w]+</defaultStaticFinal> + <private>[a-z][\w]+</private> + <privateStatic>[a-z][\w]+</privateStatic> + <privateStaticFinal>[a-z][\w]+</privateStaticFinal> + <protected>[a-z][\w]+</protected> + <protectedStatic>[a-z][\w]+</protectedStatic> + <protectedStaticFinal>[a-z][\w]+</protectedStaticFinal> + <public>[a-z][\w]+</public> + <publicStatic>[a-z][\w]+</publicStatic> + <publicStaticFinal>[a-z][\w]+</publicStaticFinal> + </methods> + <packages>[a-z]+(?:\.[a-z]+)*</packages> + <parameters> + <default>[a-z][\w]+</default> + <final>[a-z][\w]+</final> + </parameters> + <variables>[a-z][\w]*</variables> + </naming> + <tips> + <adhereToNamingConvention>false</adhereToNamingConvention> + <alwaysOverrideEquals>false</alwaysOverrideEquals> + <alwaysOverrideHashCode>false</alwaysOverrideHashCode> + <avoidThreadGroups>false</avoidThreadGroups> + <declareCollectionComment>false</declareCollectionComment> + <dontIgnoreExceptions>false</dontIgnoreExceptions> + <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals> + <neverDeclareException>false</neverDeclareException> + <neverDeclareThrowable>false</neverDeclareThrowable> + <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop> + <neverReturnZeroArrays>false</neverReturnZeroArrays> + <neverUseEmptyFinally>false</neverUseEmptyFinally> + <obeyContractEquals>false</obeyContractEquals> + <overrideToString>false</overrideToString> + <referToObjectsByInterface>false</referToObjectsByInterface> + <replaceStructureWithClass>false</replaceStructureWithClass> + <stringLiterallI18n>false</stringLiterallI18n> + <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes> + <wrongCollectionComment>false</wrongCollectionComment> + </tips> + </inspector> + <internal> + <version>6</version> + </internal> + <messages> + <priority> + <general>30000</general> + <parser>30000</parser> + <parserJavadoc>30000</parserJavadoc> + <printer>30000</printer> + <printerJavadoc>30000</printerJavadoc> + <transform>30000</transform> + </priority> + <showErrorStackTrace>true</showErrorStackTrace> + </messages> + <misc> + <threadCount>1</threadCount> + </misc> + <printer> + <alignment> + <methodCallChain>true</methodCallChain> + <parameterMethodDeclaration>false</parameterMethodDeclaration> + <ternaryOperator>true</ternaryOperator> + <variableAssignment>false</variableAssignment> + <variableIdentifier>false</variableIdentifier> + </alignment> + <backup> + <directory>bak</directory> + <level>0</level> + </backup> + <blanklines> + <after> + <block>0</block> + <braceLeft>0</braceLeft> + <class>1</class> + <declaration>0</declaration> + <footer>1</footer> + <header>1</header> + <interface>1</interface> + <lastImport>1</lastImport> + <method>1</method> + <package>1</package> + </after> + <before> + <block>0</block> + <braceRight>0</braceRight> + <caseBlock>0</caseBlock> + <comment> + <javadoc>1</javadoc> + <multiline>0</multiline> + <singleline>0</singleline> + </comment> + <controlStatement>0</controlStatement> + <declaration>0</declaration> + <footer>0</footer> + <header>0</header> + <package>2</package> + </before> + <keepUpTo>1</keepUpTo> + </blanklines> + <braces> + <empty> + <cuddle>false</cuddle> + <insertStatement>false</insertStatement> + </empty> + <insert> + <dowhile>false</dowhile> + <for>false</for> + <ifelse>false</ifelse> + <while>false</while> + </insert> + <remove> + <block>true</block> + <dowhile>true</dowhile> + <for>true</for> + <ifelse>true</ifelse> + <while>true</while> + </remove> + <treatDifferent> + <methodClass>true</methodClass> + <methodClassIfWrapped>false</methodClassIfWrapped> + </treatDifferent> + </braces> + <chunks> + <blanklines>true</blanklines> + <comments>true</comments> + </chunks> + <comments> + <format> + <multiline>false</multiline> + </format> + <javadoc> + <check> + <innerclass>false</innerclass> + <tags>false</tags> + <throwsTags>false</throwsTags> + </check> + <fieldsShort>false</fieldsShort> + <generate> + <class>0</class> + <constructor>0</constructor> + <field>0</field> + <method>0</method> + </generate> + <parseComments>false</parseComments> + <tags> + <in-line /> + <standard /> + </tags> + <templates> + <method> + <bottom> */</bottom> + <exception> * @throws $exceptionType$ DOCUMENT ME!</exception> + <param> * @param $paramType$ DOCUMENT ME!</param> + <return> * @return DOCUMENT ME!</return> + <top>/**| * DOCUMENT ME!</top> + </method> + </templates> + </javadoc> + <remove> + <javadoc>false</javadoc> + <multiline>false</multiline> + <singleline>false</singleline> + </remove> + <separator> + <fillCharacter>-</fillCharacter> + <insert>false</insert> + <insertRecursive>false</insertRecursive> + <text> + <class>Inner Classes</class> + <constructor>Constructors</constructor> + <field>Instance fields</field> + <initializer>Instance initializers</initializer> + <interface>Inner Interfaces</interface> + <method>Methods</method> + <static>Static fields/initializers</static> + </text> + </separator> + </comments> + <environment /> + <footer> + <keys /> + <smartMode>0</smartMode> + <use>false</use> + </footer> + <header> + <keys /> + <smartMode>0</smartMode> + <use>false</use> + </header> + <history> + <policy>disabled</policy> + </history> + <imports> + <grouping> + <defaultDepth>1</defaultDepth> + <packages>*:0|gnu:1|java:1|javax:1|org:1</packages> + </grouping> + <policy>disabled</policy> + <sort>true</sort> + </imports> + <indentation> + <caseFromSwitch>true</caseFromSwitch> + <continuation> + <block>true</block> + <operator>true</operator> + </continuation> + <firstColumnComments>false</firstColumnComments> + <label>true</label> + <policy> + <deep>true</deep> + </policy> + <sizes> + <braceCuddled>1</braceCuddled> + <braceLeft>2</braceLeft> + <braceRight>2</braceRight> + <braceRightAfter>0</braceRightAfter> + <continuation>0</continuation> + <deep>55</deep> + <extends>-1</extends> + <general>2</general> + <implements>-1</implements> + <leading>0</leading> + <tabs>8</tabs> + <throws>2</throws> + <trailingComment>1</trailingComment> + </sizes> + <tabs> + <enable>true</enable> + <onlyLeading>true</onlyLeading> + </tabs> + </indentation> + <misc> + <arrayBracketsAfterIdent>false</arrayBracketsAfterIdent> + <forceFormatting>false</forceFormatting> + <insertExpressionParentheses>false</insertExpressionParentheses> + <insertLoggingConditional>false</insertLoggingConditional> + <insertTrailingNewline>true</insertTrailingNewline> + <insertUID>false</insertUID> + </misc> + <sorting> + <declaration> + <class>false</class> + <constructor>false</constructor> + <enable>false</enable> + <interface>false</interface> + <method>false</method> + <order>static|field|initializer|constructor|method|interface|class</order> + <variable>false</variable> + </declaration> + <modifier> + <enable>true</enable> + <order>public|protected|private|abstract|static|final|synchronized|transient|volatile|native|strictfp</order> + </modifier> + </sorting> + <whitespace> + <after> + <comma>true</comma> + <semicolon>true</semicolon> + <typeCast>true</typeCast> + </after> + <before> + <braces>true</braces> + <brackets>false</brackets> + <bracketsTypes>false</bracketsTypes> + <caseColon>false</caseColon> + <operator> + <not>true</not> + </operator> + <parentheses> + <methodCall>false</methodCall> + <methodDeclaration>false</methodDeclaration> + <statement>true</statement> + </parentheses> + </before> + <padding> + <braces>true</braces> + <brackets>false</brackets> + <operator> + <assignment>true</assignment> + <bitwise>true</bitwise> + <logical>true</logical> + <mathematical>true</mathematical> + <relational>true</relational> + <shift>true</shift> + </operator> + <parenthesis>false</parenthesis> + <typeCast>false</typeCast> + </padding> + </whitespace> + <wrapping> + <always> + <after> + <arrayElement>0</arrayElement> + <braceRight>true</braceRight> + <extendsTypes>false</extendsTypes> + <implementsTypes>false</implementsTypes> + <label>true</label> + <methodCallChained>false</methodCallChained> + <ternaryOperator> + <first>false</first> + <second>false</second> + </ternaryOperator> + <throwsTypes>false</throwsTypes> + </after> + <before> + <braceLeft>true</braceLeft> + <extends>false</extends> + <implements>false</implements> + <throws>false</throws> + </before> + <parameter> + <methodCall>false</methodCall> + <methodCallNested>false</methodCallNested> + <methodDeclaration>false</methodDeclaration> + </parameter> + </always> + <general> + <beforeOperator>true</beforeOperator> + <enable>true</enable> + <lineLength>79</lineLength> + </general> + <ondemand> + <after> + <assignment>false</assignment> + <leftParenthesis>false</leftParenthesis> + <parameter>false</parameter> + <types> + <extends>false</extends> + <implements>false</implements> + <throws>false</throws> + </types> + </after> + <before> + <rightParenthesis>false</rightParenthesis> + </before> + <groupingParentheses>false</groupingParentheses> + </ondemand> + </wrapping> + </printer> +</jalopy> + diff --git a/libjava/classpath/scripts/japi b/libjava/classpath/scripts/japi new file mode 100755 index 00000000000..52bcbc472a5 --- /dev/null +++ b/libjava/classpath/scripts/japi @@ -0,0 +1,135 @@ +#!/bin/sh + +CLASSPATH_CVS=~/japi/classpath +JAPIZE_DIR=~/japitools-0.9 +FTPROOT=~alpha/pub/gnu/classpath/nightly/tests +LOG=/tmp/japi.log +export PATH=${PATH}:/usr/java/j2sdk1.4.1/bin + +rm -f /tmp/japi.log > /dev/null 2>&1 + +classpath_checkout () +{ + if [ ! -d "${CLASSPATH_CVS}" ]; then + mkdir --parents ${CLASSPATH_CVS} + local dir=`dirname "${CLASSPATH_CVS}"` + cd "${dir}" + cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out classpath" + exit 1 + fi + fi +} + +classpath_update () +{ + cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out classpath" + exit 1 + fi +} + +classpath_clean () +{ + if [ -d "${CLASSPATH_CVS}/build" ]; then + rm -rf "${CLASSPATH_CVS}/build" + fi +# if [ -d "${CLASSPATH_PREFIX}" ]; then +# rm -rf "${CLASSPATH_PREFIX}" +# fi + mkdir --parents "${CLASSPATH_CVS}/build" +# mkdir --parents "${CLASSPATH_PREFIX}" +} + +classpath_configure () +{ + cd "${CLASSPATH_CVS}" + aclocal >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running aclocal" + exit 1 + fi + autoheader >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running autoheader" + exit 1 + fi + automake >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running automake" + exit 1 + fi + autoconf >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running autoconf" + exit 1 + fi + cd "${CLASSPATH_CVS}/build" && ../configure --with-gcj >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error configuring" + exit 1 + fi +} + +classpath_build () +{ + cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error during make" + exit 1 + fi +} + + +japize_classpath () +{ + cd "${JAPIZE_DIR}/bin" && ./japize as classpath packages "${CLASSPATH_CVS}/build/lib/glibj.zip" +java +javax +org -java.awt.dnd.peer -java.awt.peer -org.apache -org.w3c.dom.css -org.w3c.dom.events -org.w3c.dom.html -org.w3c.dom.stylesheets -org.w3c.dom.traversal -org.w3c.dom.views -java.text.resources >> /tmp/japi.log 2>&1 + if [ $? -ne 0 ]; then + echo "Error running japize" + exit 1 + fi + cp -f "${JAPIZE_DIR}/bin/classpath.japi.gz" /tmp +} + +japicompat_classpath () +{ + today=`date` + echo "${today}" > /tmp/classpath-jdk11-compare.txt + cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk11.japi.gz classpath.japi.gz >> /tmp/classpath-jdk11-compare.txt + if [ $? -ne 0 ]; then + echo "Error running japicompat" + exit 1 + fi + echo "${today}" > /tmp/classpath-jdk13-compare.txt + cd "${JAPIZE_DIR}/bin" && ./japicompat -q jdk13.japi.gz classpath.japi.gz >> /tmp/classpath-jdk13-compare.txt + if [ $? -ne 0 ]; then + echo "Error running japicompat" + exit 1 + fi +} + +#-------------------------------------------------------------------- +# Update Classpath CVS +#-------------------------------------------------------------------- +classpath_checkout +classpath_update + +#-------------------------------------------------------------------- +# Build Classpath with GCJ 3.2 +#-------------------------------------------------------------------- +classpath_clean +classpath_configure +classpath_build + +#-------------------------------------------------------------------- +# Run japize on glibj.zip +#-------------------------------------------------------------------- +japize_classpath + +#-------------------------------------------------------------------- +# Run japicompat against jdk13 +#-------------------------------------------------------------------- +japicompat_classpath + diff --git a/libjava/classpath/scripts/kissme-mauve b/libjava/classpath/scripts/kissme-mauve new file mode 100755 index 00000000000..8a6ee22db66 --- /dev/null +++ b/libjava/classpath/scripts/kissme-mauve @@ -0,0 +1,346 @@ +#!/bin/sh + +CLASSPATH_CVS=~/mauve/classpath +CLASSPATH_PREFIX=~/mauve/root/classpath +MAUVE_CVS=~/mauve/mauve +KISSME_CVS=~/mauve/kissme +KISSME_PREFIX=~/mauve/root/kissme +KISSME_BIN=~/mauve/kissme/useful_scripts/kissme +LOG=/tmp/mauve.log +RESULTS=/tmp/kissme-mauve.txt +REPORT=/tmp/kissme-mauve-report.txt +TIMEOUT=30 + +rm -f ${LOG} > /dev/null 2>&1 +rm -f ${RESULTS} > /dev/null 2>&1 +today=`date` +echo "${today}" > ${LOG} +touch ${RESULTS} + + +_aclocal () +{ + aclocal "$@" >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running aclocal" + exit 1 + fi +} + +_autoheader () +{ + autoheader "$@" >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running autoheader" + exit 1 + fi +} + +_automake () +{ + automake "$@" >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running automake" + exit 1 + fi +} + +_autoconf () +{ + autoconf "$@" >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error running autoconf" + exit 1 + fi +} + +classpath_checkout () +{ + if [ ! -d "${CLASSPATH_CVS}" ]; then + mkdir --parents ${CLASSPATH_CVS} + local dir=`dirname "${CLASSPATH_CVS}"` + cd "${dir}" + cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out classpath" + exit 1 + fi + fi +} + +classpath_update () +{ + cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out classpath" + exit 1 + fi +} + +classpath_clean () +{ + if [ -d "${CLASSPATH_CVS}/build" ]; then + rm -rf "${CLASSPATH_CVS}/build" + fi + if [ -d "${CLASSPATH_PREFIX}" ]; then + rm -rf "${CLASSPATH_PREFIX}" + fi + mkdir --parents "${CLASSPATH_CVS}/build" + mkdir --parents "${CLASSPATH_PREFIX}" +} + +classpath_configure () +{ + cd "${CLASSPATH_CVS}" + + _aclocal + _autoheader + _automake + _autoconf + + cd "${CLASSPATH_CVS}/build" && ../configure --prefix=${CLASSPATH_PREFIX} --with-gcj --enable-jni >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error configuring" + exit 1 + fi +} + +classpath_build () +{ + cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error during make" + exit 1 + fi +} + +classpath_install () +{ + cd "${CLASSPATH_CVS}/build" && make install >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error during make" + exit 1 + fi +} + +kissme_checkout () +{ + if [ ! -d "${KISSME_CVS}" ]; then + mkdir --parents ${KISSME_CVS} + local dir=`dirname "${KISSME_CVS}"` + cd "${KISSME_CVS}" + cvs -z3 -d :pserver:anonymous@cvs.kissme.sourceforge.net:/cvsroot/kissme co . >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out kissme" + exit 1 + fi + fi +} + +kissme_update () +{ + cd "${KISSME_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out kissme" + exit 1 + fi +} + +kissme_clean () +{ + if [ -d "${KISSME_CVS}/build" ]; then + rm -rf "${KISSME_CVS}/build" + fi + if [ -d "${KISSME_PREFIX}" ]; then + rm -rf "${KISSME_PREFIX}" + fi + mkdir --parents "${KISSME_CVS}/build" + mkdir --parents "${KISSME_PREFIX}" +} + +kissme_configure () +{ + cd "${KISSME_CVS}" + + _aclocal + _autoheader + _automake -a + _autoconf + + cd "${KISSME_CVS}" && ./configure --prefix=${KISSME_PREFIX} \ + --enable-use-zips --with-gnu-classpath=${CLASSPATH_CVS} \ + --with-gnu-classpath-build=${CLASSPATH_CVS}/build \ + --with-classpath-install-dir=${CLASSPATH_PREFIX} >> ${LOG} 2>&1 + + if [ $? -ne 0 ]; then + echo "Error configuring" + exit 1 + fi +} + +kissme_build () +{ + cd "${KISSME_CVS}" && make >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error during make" + exit 1 + fi +} + +kissme_install () +{ + cd "${KISSME_CVS}" && make install >> ${LOG} 2>&1 + if [ $? -ne 0 ]; then + echo "Error during make" + exit 1 + fi +} + +mauve_checkout () +{ + if [ ! -d "${MAUVE_CVS}" ]; then + mkdir --parents ${MAUVE_CVS} + local dir=`dirname "${MAUVE_CVS}"` + cd "${dir}" + cvs -z3 -d :pserver:anoncvs@sources.redhat.com:/cvs/mauve co mauve >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out mauve" + exit 1 + fi + fi +} + +mauve_update () +{ + cd "${MAUVE_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null + if [ $? -ne 0 ]; then + echo "Error checking out mauve" + exit 1 + fi +} + +kissme_mauve () +{ + export JAVAC="jikes -bootclasspath ${CLASSPATH_PREFIX}/share/classpath/glibj.zip" + export JAVA="${KISSME_BIN}" + +# if [ -f "${KISSME_CVS}/useful_scripts/mauve-kissme" ]; then +# cp -f "${KISSME_CVS}/useful_scripts/mauve-kissme" "${MAUVE_CVS}" +# fi + + if [ -f "${CLASSPATH_CVS}/mauve-classpath" ]; then + cp -f "${CLASSPATH_CVS}/mauve-classpath" "${MAUVE_CVS}" + fi + + cd "${MAUVE_CVS}" + if [ $? -ne 0 ]; then + echo "Error configuring mauve" + exit 1 + fi + + _aclocal + _automake + _autoconf + + ./configure >> "${LOG}" 2>&1 + if [ $? -ne 0 ]; then + echo "Error configuring mauve" + exit 1 + fi + + # create class choices from key file + if [ -f classes ]; then + rm -f classes 2>/dev/null + fi + if [ -f choices ]; then + rm -f choices 2>/dev/null + fi + /bin/sh choose "${MAUVE_CVS}" classpath + if [ $? -ne 0 ]; then + echo "Error during choose for mauve" + exit 1 + fi + + # compile classes + compile=`cat "${MAUVE_CVS}/classes" | tr '.' '/' | awk '{print $1".java"}' | xargs` + ${JAVAC} -classpath "${MAUVE_CVS}" -d "${MAUVE_CVS}" ${compile} >> "${LOG}" 2>&1 + if [ $? -ne 0 ]; then + echo "Error during compile for mauve" + exit 1 + fi + + set -m + for i in `cat "${MAUVE_CVS}/classes"`; do + echo "$i" | ${JAVA} gnu.testlet.SimpleTestHarness -verbose >> "${RESULTS}" 2>&1 & + + vm_pid=$! + sleep ${TIMEOUT} && kill -9 $vm_pid > /dev/null 2>&1 && echo "FAIL: $i execution aborted" >> "${RESULTS}" & + kill_pid=$! + fg %- 2>/dev/null + kill -9 $kill_pid >/dev/null 2>&1 # && echo Test did not time out + done +} + +mauve_summary () +{ + if [ ! -f "${RESULTS}" ]; then + echo "Error creating summary" + exit 1 + fi + + pass_cnt=`grep PASS "${RESULTS}" | wc -l` + fail_cnt=`grep FAIL "${RESULTS}" | wc -l` + total_cnt=`expr $pass_cnt + $fail_cnt` + + today=`date` + echo "Mauve test results for Kissme" > "${REPORT}" + echo "Report generated on ${today}" >> "${REPORT}" + echo "" >> "${REPORT}" + echo "${fail_cnt} of ${total_cnt} tests failed." >> "${REPORT}" + echo "" >> "${REPORT}" + cat "${RESULTS}" >> "${REPORT}" +} + +#-------------------------------------------------------------------- +# Update Classpath CVS +#-------------------------------------------------------------------- +classpath_checkout +classpath_update + +#-------------------------------------------------------------------- +# Build Classpath with GCJ 3.2 +#-------------------------------------------------------------------- +classpath_clean +classpath_configure +classpath_build +classpath_install + +#-------------------------------------------------------------------- +# Update Kissme CVS +#-------------------------------------------------------------------- +kissme_checkout +kissme_update + +#-------------------------------------------------------------------- +# Build Kissme +#-------------------------------------------------------------------- +kissme_clean +kissme_configure +kissme_build +#kissme_install + +#-------------------------------------------------------------------- +# Update Mauve CVS +#-------------------------------------------------------------------- +mauve_checkout +mauve_update + +#-------------------------------------------------------------------- +# Execute Mauve +#-------------------------------------------------------------------- +kissme_mauve + +#-------------------------------------------------------------------- +# Create report +#-------------------------------------------------------------------- +mauve_summary diff --git a/libjava/classpath/scripts/loc b/libjava/classpath/scripts/loc new file mode 100755 index 00000000000..dc2f327035f --- /dev/null +++ b/libjava/classpath/scripts/loc @@ -0,0 +1,44 @@ +#!/bin/sh +# +# loc Find a class or package +# +# Usage: loc [-l] class-pattern [dirname] + +# -l Use system locate command instead of find. In that case, loc +# will ignore any directory to be searched. + +# Example: +# +# $ loc -l org.objectweb.jonas.common.JProp +# /var/lib/jonas/demoserver/ejbjars/autoload/mejb.jar +# /var/lib/jonas/lib/common/ow_jonas_bootstrap.jar +# /var/lib/jonas/eclipseserver/ejbjars/autoload/mejb.jar +# /var/lib/jonas/ejbjars/autoload/mejb.jar +# /var/cache/jonas/work/ejbjars/jonas/mejb_2005.09.15-17.01.52.jar +# /usr/src/redhat/BUILD/jonas-4.3.3/jonas/classes/common/org/objectweb/jonas/common/JProp.class + + +MODE=$1 +if test "$MODE" == "-l"; then + COMMAND='(locate \*.jar ; locate \*.war)' + shift +else + COMMAND='(find "$FOO" -name \*.jar -follow ; find "$FOO" -name \*.war -follow)' +fi + +FOO=$2 +if test "x$FOO" == "x"; then + FOO=/usr/share/java +fi + +eval "$COMMAND" 2>/dev/null | while read i; do + if (fastjar tf $i 2>/dev/null | grep $1) > /dev/null 2>&1 ; then + echo $i + fi +done + +if test "$MODE" != "-l"; then + find "$FOO" -name '*.class' 2>/dev/null | grep $1 +else + locate \*.class | grep $1 +fi diff --git a/libjava/classpath/scripts/math_symbols b/libjava/classpath/scripts/math_symbols new file mode 100644 index 00000000000..e676a5197dc --- /dev/null +++ b/libjava/classpath/scripts/math_symbols @@ -0,0 +1,69 @@ +acos +asin +atan +atan2 +cos +sin +tan +cosh +sinh +tanh +exp +frexp +ldexp +expm1 +log +log10 +log1p +modf +pow +sqrt +ceil +fabs +floor +fmod +erf +erfc +gamma +hypot +finite +j0 +j1 +jn +lgamma +y0 +y1 +yn +acosh +asinh +cbrt +logb +nextafter +remainder +logb +scalb +significand +logbf +scalbf +significandf +copysign +ilogb +rint +rintf +scalbn +__ieee754_sqrt +__ieee754_asin +__ieee754_asin +__ieee754_atan2 +__ieee754_exp +__ieee754_fmod +__ieee754_log +__ieee754_pow +__ieee754_rem_pio2 +__ieee754_remainder +__ieee754_scalb +__ieee754_acos +__kernel_cos +__kernel_sin +__kernel_tan +__kernel_rem_pio2 diff --git a/libjava/classpath/scripts/patches.pl b/libjava/classpath/scripts/patches.pl new file mode 100755 index 00000000000..57f134d9201 --- /dev/null +++ b/libjava/classpath/scripts/patches.pl @@ -0,0 +1,164 @@ +#!/usr/bin/perl -w +# Purpose is to move patches from upload directory to +# public patches directory. Any file not matching the correct +# pattern is deleted. Any patch file without a README and the +# file was last modified more than 120 minutes ago is deleted. +# Any README file without a patch file which was last modified +# more than 120 minutes ago is deleted. +# +# notes to self: as long as this runs as root do not worry +# about quota problems or disk space + +use strict; + +my ($upload_dir) = "/home/ftp/classpath/incoming"; +my ($public_dir) = "/home/ftp/classpath/pub/patches"; +my ($user) = "classpath"; +my ($group) = "classpath"; +my ($mode_dir) = "775"; +my ($mode_file) = "664"; +my (@patches) = (); + +use vars qw($upload_dir $public_dir @patches $user $group + $mode_dir $mode_file); + +# main +{ + @patches = &getPatches(); + &movePatches(@patches); +} + +#--------------------------------------------------------------- +# Purpose: To remove files not matching the correct pattern. +# To remove README files without patches (last modified greater +# than 2 hours). To remove patches without README files (last +# modified greater than 2 hours). +#--------------------------------------------------------------- +sub getPatches +{ + my (@patches) = (); + my (@entries) = (); + my (%maybe) = (); + my ($entry, $debug, $prefix, $junk, $file, $patch, $readme) = ""; + my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, + $mtime, $ctime, $blksize, $blocks) = ""; + + $debug = 1; + + opendir(INCOMING, "$upload_dir") || die "could not open $upload_dir\n"; + @entries = grep( !/^\.\S+/, readdir(INCOMING)); # no .* + closedir(INCOMING); + foreach $entry (sort @entries) + { + if (($entry eq ".") || ($entry eq "..")) { next; } + if (-d "$upload_dir/$entry") + { + print "Directory: $upload_dir/$entry/\n"; + } + elsif (-e "$upload_dir/$entry") + { + if ($entry eq ".message") { next; } + if ($entry eq "README") { next; } + if ($entry !~ /^\w+-\d\d\d\d\d\d-\d+\.patch\.(gz|README)$/) + { + print "REGEX FAILED: $entry\n"; + unlink("$upload_dir/$entry"); + } + else + { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime, + $ctime,$blksize,$blocks) = stat("$upload_dir/$entry"); + if ($size > 512000) + { + print "LARGE PATCH: $entry\n"; + unlink("$upload_dir/$entry"); + } + else + { + ($prefix,$junk) = split(/(\.gz|\.README)/, $entry, 2); + $maybe{$prefix} += 1; + } + } + } + } + + foreach $entry (keys(%maybe)) + { + if ($maybe{$entry} == 2) + { + $patch = "$entry.gz"; + $readme = "$entry.README"; + + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime, + $ctime,$blksize,$blocks) = stat($patch); + if (time-$mtime > 900) + { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime, + $ctime,$blksize,$blocks) = stat($readme); + if (time-$mtime > 900) + { + $patches[$#patches+1] = $entry; + } + } + } + else + { + if (-e "$upload_dir/$entry.gz") + { + unlink("$upload_dir/$entry.gz"); + print "STALE PATCH: $entry.gz\n"; + } + elsif (-e "$upload_dir/$entry.README") + { + unlink("$upload_dir/$entry.README"); + print "STALE README: $entry.README\n"; + } + } + } + return (@patches); +} + +#--------------------------------------------------------------- +# Purpose: To move the patches to the proper directory and set +# the permissions correctly. +#--------------------------------------------------------------- +sub movePatches +{ + my (@patches) = @_; + my ($patch) = ""; + my ($fail) = 0; + + if (!(-d "$public_dir")) + { + system("mkdir -p $public_dir"); + system("chown $user.$group $public_dir"); + system("chmod $mode_dir $public_dir"); + } + foreach $patch (@patches) + { + if (-e "$public_dir/$patch.gz") + { + print "Patch exists: $public_dir/$patch.gz\n"; + $fail = 1; + } + if (-e "$public_dir/$patch.README") + { + print "README exists: $public_dir/$patch.README\n"; + $fail = 1; + } + if ($fail == 0) + { + system("mv $upload_dir/$patch.gz $public_dir/$patch.gz"); + system("mv $upload_dir/$patch.README $public_dir/$patch.README"); + system("chown $user.$group $public_dir/*"); + system("chmod $mode_file $public_dir/*"); + open(MAIL, "|mail -s \"Classpath: $patch uploaded\" core\@classpath.org") || die "could not open mail\n"; + print MAIL "GNU Classpath FTP Maintenance\n"; + print MAIL "\n"; + print MAIL "Added Files:\n"; + print MAIL "ftp://ftp.classpath.org/pub/patches/$patch.gz\n"; + print MAIL "ftp://ftp.classpath.org/pub/patches/$patch.README\n\n"; + close(MAIL); + } + } +} diff --git a/libjava/classpath/scripts/sanitize-jsr166 b/libjava/classpath/scripts/sanitize-jsr166 new file mode 100755 index 00000000000..d4ca8585b8b --- /dev/null +++ b/libjava/classpath/scripts/sanitize-jsr166 @@ -0,0 +1,6 @@ +#! /bin/sh + +# Sanitize a jsr166 download. + +# Remove code copyright Sun. +find . -name '*.java' -print | xargs grep -l 'Copyright.*Sun' | xargs rm diff --git a/libjava/classpath/scripts/timezones.pl b/libjava/classpath/scripts/timezones.pl new file mode 100755 index 00000000000..142ea4b7582 --- /dev/null +++ b/libjava/classpath/scripts/timezones.pl @@ -0,0 +1,366 @@ +#!/usr/bin/perl -w +# Create the timezone tables for java/util/TimeZone from the +# standard timezone sources by Arthur David Olson (as used by glibc) +# +# This needs the files from the package tzdata2000h which may be found +# at ftp://ftp.cs.mu.oz.au/pub/. + +$TIMEZONEDIR = "tzdata"; +@TIMEZONEFILES = ("africa", "antarctica", "asia", "australasia", + "europe", "northamerica", "pacificnew", "southamerica", + "../tzabbrevs"); + +# rules hash table: +# key is a rule name +# value is either "-" (no daylight savings) or a list of three elements: +# $value[0] = end savings rule (list containing MONTH, DAY and TIME) +# $value[1] = start savings rule (ditto) +# $value[2] = daylight offset in milliseconds +my %rules = ("-" => "-"); + +# timezones list, list of pairs: +# $timezones[$i][0] is a timezone name +# $timezones[$i][1] = raw offset in milliseconds +# $timezones[$i][2] = rule in the same format as the value of +# the rules table, but TIME in milliseconds +# $timezones[$i][3] = list of timezone names with this rule (aliases) +my @timezones = ( [ "GMT", 0, "-", [ "GMT", "UTC" ] ]); + + +# parse the offset of form +/-hh:mm:ss (:ss is optional) and return it +# in milliseconds against UTC +sub parseOffset($) { + my $offset = $_[0]; + $offset =~ /^([+-]?)(\d+)(:(\d+)(:(\d+))?)?$/ + or die "Can't parse offset $offset"; + my $seconds = $2 * 3600; + $seconds += $4 * 60 if ($3); + $seconds += $6 if ($3 && $5); + if ($1 eq "-") { + $seconds = - $seconds; + } + return $seconds * 1000; +} + +# parse the time of form +/-hh:mm:ss[swguz] (:ss is optional) and return it +# in milliseconds since midnight in local wall time + my $timezonename; +sub parseTime($$$) { + my ($rawoffset, $stdoffset, $time) = @_; + $time =~ /^([+-]?)(\d+):(\d+)(:(\d+))?([swguz]?)$/ + or die "Can't parse time $time"; + my ($hour, $min) = ($2, $3); + my $sec = ($4) ? $5 : 0; + my $millis = ((($hour * 60) + $min) * 60 + $sec) * 1000; + if ($1 eq "-") { + $millis = -$millis; + } + # Normally millis is in wall time, adjust for utc and standard time. + if ($6 =~ /[guz]/) { + $millis += $rawoffset + $stdoffset; + } elsif ($6 =~ /s/) { + $millis += $stdoffset; + } + return $millis; +} + +my %monthnames = + ( "Jan" => "1", + "Feb" => "2", + "Mar" => "3", + "Apr" => "4", + "May" => "5", + "Jun" => "6", + "Jul" => "7", + "Aug" => "8", + "Sep" => "9", + "Oct" => "10", + "Nov" => "11", + "Dec" => "12" ); +sub parseMonth($) { + my $month = $monthnames{"$_[0]"} or die "Unknown month $_[0]"; + return $month; +} + +my %weekdaynames = + ( "Sun" => "7", + "Mon" => "1", + "Tue" => "2", + "Wed" => "3", + "Thu" => "4", + "Fri" => "5", + "Sat" => "6" ); +sub parseWeekday($) { + my $weekday = $weekdaynames{"$_[0]"} or die "Unknown weekday $_[0]"; + return $weekday; +} + +my @weekdayjavanames = + ( "Calendar.SUNDAY", + "Calendar.MONDAY", + "Calendar.TUESDAY", + "Calendar.WEDNESDAY", + "Calendar.THURSDAY", + "Calendar.FRIDAY", + "Calendar.SATURDAY" ); +my @daysInMonths = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); +sub parseDay($$$) { + my ($dayoffset, $month, $day) = @_; + if ($day =~ /^\d+$/) { + return "$day, 0"; + } elsif ($day =~ /^last([A-Z][a-z][a-z])$/) { + my $weekday = ( parseWeekday($1) + $dayoffset + 7 ) % 7; + if ($dayoffset) { + my $day = $daysInMonths[$month - 1] + $dayoffset; + warn "Can only approximate $day with dayoffset in $file" + if ($month == 2); + return "$day, -$weekdayjavanames[$weekday]"; + } else { + return "-1, $weekdayjavanames[$weekday]"; + } + } elsif ($day =~ /^([A-Z][a-z][a-z])>=(\d+)$/) { + my $start = $2 + $dayoffset; + my $weekday = ( parseWeekday($1) + $dayoffset + 7 ) % 7; + if (($start % 7) == 1) { + $start = ($start + 6) / 7; + return "$start, $weekdayjavanames[$weekday]"; + } else { + return "$start, -$weekdayjavanames[$weekday]"; + } + } else { + die "Unknown day $day"; + } +} + +my @monthjavanames = + ( "Calendar.JANUARY", + "Calendar.FEBRUARY", + "Calendar.MARCH", + "Calendar.APRIL", + "Calendar.MAY", + "Calendar.JUNE", + "Calendar.JULY", + "Calendar.AUGUST", + "Calendar.SEPTEMBER", + "Calendar.OCTOBER", + "Calendar.NOVEMBER", + "Calendar.DECEMBER" ); + +sub parseRule($$$) { + my ($rawoffset, $stdoffset, $rule) = @_; + my $monthnr = parseMonth($rule->[0]); + my $time = parseTime($rawoffset, $stdoffset, $rule->[2]); + my $dayoffset = 0; + while ($time < 0) { + $time += 24*3600*1000; + $dayoffset--; + } + while ($time > 24*3600*1000) { + $time -= 24*3600*1000; + $dayoffset++; + } + $day = parseDay($dayoffset, $monthnr, $rule->[1]); + return [ $monthjavanames[$monthnr-1], $day, $time ]; +} + + +sub ruleEquals($$) { + my ($rule1, $rule2) = @_; + # check month names + return (($rule1->[0] eq $rule2->[0]) + && ($rule1->[1] eq $rule2->[1]) + && ($rule1->[2] == $rule2->[2])); +} + +sub findAlias($$) { + my ($rawoffset, $rule) = @_; + foreach $tz (@timezones) { + my ($key, $tzoffset, $tzrule, $aliaslist) = @{$tz}; + next if ($tzoffset != $rawoffset); + if ($rule eq "-") { + return $tz if ($tzrule eq "-"); + } elsif ($tzrule ne "-") { + next if $rule->[2] != $tzrule->[2]; + if (ruleEquals($rule->[0], $tzrule->[0]) + && ruleEquals($rule->[1], $tzrule->[1])) { + return $tz; + } + } + } + return ""; +} + +sub makePretty($) { + my ($offset) = @_; + if (($offset % 3600) == 0) { + $offset /= 3600; + return "$offset * 3600"; + } else { + return "$offset"; + } +} + +sub tzcompare($$) { + my ($a, $b) = @_; + if (($a =~ /\//) != ($b =~ /\//)) { + return ($a =~ /\//) ? 1 : -1; + } else { + return $a cmp $b; + } +} + +foreach $file (@TIMEZONEFILES) { +# print STDERR "$file\n"; + open INPUT, "$TIMEZONEDIR/$file" or die "Can't open $TIMEZONEDIR/$file"; + my $in_time_zone = 0; + while (<INPUT>) { + $_ = $1 if /^([^\#]*)\#/; + next if /^\s*$/; + my @entries = split; +# $, = ","; print "'$_' -> [",@entries,"]\n"; + if (!$in_time_zone) { + if ($entries[0] eq "Rule") { + # check if rule still applies + # column 3 is TO entry. + if ($entries[3] eq "max") { + my $rulename = $entries[1]; + my $month = $entries[5]; + my $day = $entries[6]; + my $time = $entries[7]; + if ($entries[8] eq "0") { + # This is the end time rule + $rules{"$rulename"}[0] = [ $month, $day, $time ]; + } else { + # This is the start time rule + $rules{"$rulename"}[1] = [ $month, $day, $time ]; + $rules{"$rulename"}[2] = parseOffset($entries[8]); + } + } + } elsif ($entries[0] eq "Zone") { + $in_time_zone = 1; + shift @entries; + $timezonename = shift @entries; + } elsif ($entries[0] eq "Remove") { + my $found = 0; + foreach $tz (@timezones) { + my @newaliases; + foreach $tzname (@{$tz->[3]}) { + if ($tzname eq $entries[1]) { + $found = 1; + } else { + push @newaliases, $tzname; + } + } + if ($found) { + if ($tz->[0] eq $entries[1]) { + $tz->[0] = $newaliases[0]; + } + $tz->[3] = \@newaliases; + last; + } + } + + die "Unknown link $_" if ! $found; + } elsif ($entries[0] eq "Link") { + my $alias = 0; + foreach $tz (@timezones) { + foreach $tzname (@{$tz->[3]}) { + if ($tzname eq $entries[1]) { + $alias = $tz; + last; + } + } + } + + die "Unknown link $_" if ! $alias; + die "@entries" if $entries[1] =~ /^\d+$/; + push @{$alias->[3]}, $entries[2]; + } else { + die "Unknown command: $_"; + } + } + if ($in_time_zone) { + die "early end of Zone: $_" if ($entries[0] =~ /^[A-Za-z]+/); + if (@entries <= 3) { +# print "found ZONE $timezonename $entries[0] $entries[1] $entries[2]\n"; + # This is the last line and the only we look at. + # other lines are for historic time zones. + my $rawoffset = parseOffset($entries[0]); + my $rule = $rules{"$entries[1]"} || "-"; + if ($rule ne "-") { + if (!defined($rule->[2])) { + $rule = "-"; + } else { + # now we can parse the time since we know raw offset. + my $savings = $rule->[2]; + my $endrule = parseRule($rawoffset, $savings, + $rule->[0]); + my $startrule = parseRule($rawoffset, $savings, + $rule->[1]); + $rule = [ $endrule, $startrule, $savings ]; +# print "start",@{$rule->[1]}, "end", @{$rule->[0]}, +# "offset", $rule->[2],"\n"; + } + } + my $alias = findAlias($rawoffset, $rule); + if ($alias) { + if (($alias->[0] =~ /\//) + && ($timezonename !~ /\//)) { + # alias is of Country/City form, timezonename not + # make timezonename the real zone name + $alias->[0] = $timezonename; + } + push @{$alias->[3]}, $timezonename; + } else { + push @timezones, [ $timezonename, $rawoffset, $rule, + [ $timezonename ] ]; + } + $in_time_zone = 0; + } + } + } + close INPUT; +} + +@timezones = sort { if ($a->[1] != $b->[1]) { $a->[1] <=> $b->[1] } + else { $a->[0] cmp $b->[0] } } @timezones; +for (@timezones) { + my ($name, $rawoffset, $rule, $aliaslist) = @{$_}; + my @aliases = sort { tzcompare($a, $b); } @{$aliaslist}; + $name = $aliases[0]; + $rawoffset = makePretty($rawoffset); + if ($rule eq "-") { + print <<EOF + tz = new SimpleTimeZone($rawoffset, \"$name\"); +EOF + } else { + my ($endmonth, $endday, $endtime) = @{$rule->[0]}; + my ($startmonth, $startday, $starttime) = @{$rule->[1]}; + $endtime = makePretty($endtime); + $starttime = makePretty($starttime); + my $savings = $rule->[2]; + if ($savings == 3600 * 1000) { + print <<EOF + tz = new SimpleTimeZone + ($rawoffset, \"$name\", + $startmonth, $startday, $starttime, + $endmonth, $endday, $endtime); +EOF + } else { + $savings = makePretty($savings); + print <<EOF + tz = new SimpleTimeZone + ($rawoffset, \"$name\", + $startmonth, $startday, $starttime, + $endmonth, $endday, $endtime, $savings); +EOF + } + } + for (@aliases) { + print <<EOF + timezones0.put(\"$_\", tz); +EOF + } +} + + diff --git a/libjava/classpath/scripts/tzabbrevs b/libjava/classpath/scripts/tzabbrevs new file mode 100644 index 00000000000..f033f08ab0d --- /dev/null +++ b/libjava/classpath/scripts/tzabbrevs @@ -0,0 +1,40 @@ +Link Pacific/Niue MIT +Link America/Juneau AST +Link PST8PDT PST +# XXX: Remove PST8PDT after java.lang.System is merged with libgcj? +# Remove PST8PDT +Link MST PNT +# XXX: Remove MST7 after java.lang.System is merged with libgcj? +Link MST MST7 +Remove MST +Link MST7MDT MST +# XXX: Remove MST7MDT after java.lang.System is merged with libgcj? +# Remove MST7MDT +Link CST6CDT CST +# XXX: Remove CST6CDT after java.lang.System is merged with libgcj? +# Remove CST6CDT +Link EST IET +# XXX: Remove EST5 after java.lang.System is merged with libgcj? +Link EST EST5 +Remove EST +Link EST5EDT EST +# XXX: Remove EST5EDT after java.lang.System is merged with libgcj? +# Remove EST5EDT +Link America/Anguilla PRT +Link America/Argentina/Buenos_Aires AGT +Link America/St_Johns CNT +Link CET ECT +Link Africa/Cairo ART +Link Africa/Gaborone CAT +Link Indian/Comoro EAT +Link Indian/Mauritius NET +Link Indian/Kerguelen PLT +Link Asia/Calcutta IST +Link Asia/Colombo BST +Link Asia/Bangkok VST +Link Asia/Brunei CTT +Link Asia/Seoul JST +Link Australia/Darwin ACT +Link Australia/Sydney AET +Link Pacific/Ponape SST +Link Pacific/Auckland NST diff --git a/libjava/classpath/scripts/unicode-blocks.pl b/libjava/classpath/scripts/unicode-blocks.pl new file mode 100755 index 00000000000..301cd1dd893 --- /dev/null +++ b/libjava/classpath/scripts/unicode-blocks.pl @@ -0,0 +1,364 @@ +#!/usr/bin/perl -w +# unicode-blocks.pl -- Script to generate java.lang.Character.UnicodeBlock +# Copyright (C) 2002, 2004 Free Software Foundation, Inc. +# +# This file is part of GNU Classpath. +# +# GNU Classpath is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Classpath is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Classpath; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + + +# Code for reading Blocks.txt and generating (to standard out) the code for +# java.lang.Character.UnicodeBlock, for pasting into java/lang/Character.java. +# You should probably check that the results are accurate to the +# specification, but I made sure it works OOB for Unicode 3.0.0 and JDK 1.4. +# As the grammar for the Blocks.txt file is changing in Unicode 3.2.0, you +# will have to tweak this some for future use. For now, the relevant +# Unicode definition files are found in doc/unicode/. +# +# author Eric Blake <ebb9@email.byu.edu> +# +# usage: unicode-blocks.pl <blocks.txt> +# where <blocks.txt> is obtained from www.unicode.org (named Blocks-3.txt +# for Unicode version 3.0.0). + + +die "Usage: $0 <blocks.txt>" unless @ARGV == 1; +open (BLOCKS, $ARGV[0]) || die "Can't open Unicode block file: $!\n"; + +# A hash of added fields and the JDK they were added in, to automatically +# print @since tags. Maintaining this is optional (and tedious), but nice. +my %additions = ("SYRIAC" => "1.4", + "THAANA" => "1.4", + "SINHALA" => "1.4", + "MYANMAR" => "1.4", + "ETHIOPIC" => "1.4", + "CHEROKEE" => "1.4", + "UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS" => "1.4", + "OGHAM" => "1.4", + "RUNIC" => "1.4", + "KHMER" => "1.4", + "MONGOLIAN" => "1.4", + "BRAILLE_PATTERNS" => "1.4", + "CJK_RADICALS_SUPPLEMENT" => "1.4", + "KANGXI_RADICALS" => "1.4", + "IDEOGRAPHIC_DESCRIPTION_CHARACTERS" => "1.4", + "BOPOMOFO_EXTENDED" => "1.4", + "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A" => "1.4", + "YI_SYLLABLES" => "1.4", + "YI_RADICALS" => "1.4", + "CYRILLIC_SUPPLEMENTARY" => "1.5", + "TAGALOG" => "1.5", + "HANUNOO" => "1.5", + "BUHID" => "1.5", + "TAGBANWA" => "1.5", + "LIMBU" => "1.5", + "TAI_LE" => "1.5", + "KHMER_SYMBOLS" => "1.5", + "PHONETIC_EXTENSIONS" => "1.5", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A" => "1.5", + "SUPPLEMENTAL_ARROWS_A" => "1.5", + "SUPPLEMENTAL_ARROWS_B" => "1.5", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B" => "1.5", + "SUPPLEMENTAL_MATHEMATICAL_OPERATORS" => "1.5", + "MISCELLANEOUS_SYMBOLS_AND_ARROWS" => "1.5", + "KATAKANA_PHONETIC_EXTENSIONS" => "1.5", + "YIJING_HEXAGRAM_SYMBOLS" => "1.5", + "VARIATION_SELECTORS" => "1.5", + "LINEAR_B_SYLLABARY" => "1.5", + "LINEAR_B_IDEOGRAMS" => "1.5", + "AEGEAN_NUMBERS" => "1.5", + "OLD_ITALIC" => "1.5", + "GOTHIC" => "1.5", + "UGARITIC" => "1.5", + "DESERET" => "1.5", + "SHAVIAN" => "1.5", + "OSMANYA" => "1.5", + "CYPRIOT_SYLLABARY" => "1.5", + "BYZANTINE_MUSICAL_SYMBOLS" => "1.5", + "MUSICAL_SYMBOLS" => "1.5", + "TAI_XUAN_JING_SYMBOLS" => "1.5", + "MATHEMATICAL_ALPHANUMERIC_SYMBOLS" => "1.5", + "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B" => "1.5", + "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT" => "1.5", + "TAGS" => "1.5", + "VARIATION_SELECTORS_SUPPLEMENT" => "1.5", + "SUPPLEMENTARY_PRIVATE_USE_AREA_A" => "1.5", + "SUPPLEMENTARY_PRIVATE_USE_AREA_B" => "1.5", + "HIGH_SURROGATES" => "1.5", + "HIGH_PRIVATE_USE_SURROGATES" => "1.5", + "LOW_SURROGATES" => "1.5" + ); + +print <<'EOF'; + /** + * A family of character subsets in the Unicode specification. A character + * is in at most one of these blocks. + * + * This inner class was generated automatically from + * <code>$ARGV[0]</code>, by some perl scripts. + * This Unicode definition file can be found on the + * <a href="http://www.unicode.org">http://www.unicode.org</a> website. + * JDK 1.5 uses Unicode version 4.0.0. + * + * @author scripts/unicode-blocks.pl (written by Eric Blake) + * @since 1.2 + */ + public static final class UnicodeBlock extends Subset + { + /** The start of the subset. */ + private final int start; + + /** The end of the subset. */ + private final int end; + + /** The canonical name of the block according to the Unicode standard. */ + private final String canonicalName; + + /** Enumeration for the <code>forName()</code> method */ + private enum NameType { CANONICAL, NO_SPACES, CONSTANT; }; + + /** + * Constructor for strictly defined blocks. + * + * @param start the start character of the range + * @param end the end character of the range + * @param name the block name + * @param canonicalName the name of the block as defined in the Unicode + * standard. + */ + private UnicodeBlock(int start, int end, String name, + String canonicalName) + { + super(name); + this.start = start; + this.end = end; + this.canonicalName = canonicalName; + } + + /** + * Returns the Unicode character block which a character belongs to. + * <strong>Note</strong>: This method does not support the use of + * supplementary characters. For such support, <code>of(int)</code> + * should be used instead. + * + * @param ch the character to look up + * @return the set it belongs to, or null if it is not in one + */ + public static UnicodeBlock of(char ch) + { + return of((int) ch); + } + + /** + * Returns the Unicode character block which a code point belongs to. + * + * @param codePoint the character to look up + * @return the set it belongs to, or null if it is not in one. + * @throws IllegalArgumentException if the specified code point is + * invalid. + * @since 1.5 + */ + public static UnicodeBlock of(int codePoint) + { + if (codePoint > MAX_CODE_POINT) + throw new IllegalArgumentException("The supplied integer value is " + + "too large to be a codepoint."); + // Simple binary search for the correct block. + int low = 0; + int hi = sets.length - 1; + while (low <= hi) + { + int mid = (low + hi) >> 1; + UnicodeBlock b = sets[mid]; + if (codePoint < b.start) + hi = mid - 1; + else if (codePoint > b.end) + low = mid + 1; + else + return b; + } + return null; + } + + /** + * <p> + * Returns the <code>UnicodeBlock</code> with the given name, as defined + * by the Unicode standard. The version of Unicode in use is defined by + * the <code>Character</code> class, and the names are given in the + * <code>Blocks-<version>.txt</code> file corresponding to that version. + * The name may be specified in one of three ways: + * </p> + * <ol> + * <li>The canonical, human-readable name used by the Unicode standard. + * This is the name with all spaces and hyphens retained. For example, + * `Basic Latin' retrieves the block, UnicodeBlock.BASIC_LATIN.</li> + * <li>The canonical name with all spaces removed e.g. `BasicLatin'.</li> + * <li>The name used for the constants specified by this class, which + * is the canonical name with all spaces and hyphens replaced with + * underscores e.g. `BASIC_LATIN'</li> + * </ol> + * <p> + * The names are compared case-insensitively using the case comparison + * associated with the U.S. English locale. The method recognises the + * previous names used for blocks as well as the current ones. At + * present, this simply means that the deprecated `SURROGATES_AREA' + * will be recognised by this method (the <code>of()</code> methods + * only return one of the three new surrogate blocks). + * </p> + * + * @param blockName the name of the block to look up. + * @return the specified block. + * @throws NullPointerException if the <code>blockName</code> is + * <code>null</code>. + * @throws IllegalArgumentException if the name does not match any Unicode + * block. + * @since 1.5 + */ + public static final UnicodeBlock forName(String blockName) + { + NameType type; + if (blockName.indexOf(' ') != -1) + type = NameType.CANONICAL; + else if (blockName.indexOf('_') != -1) + type = NameType.CONSTANT; + else + type = NameType.NO_SPACES; + Collator usCollator = Collator.getInstance(Locale.US); + usCollator.setStrength(Collator.PRIMARY); + /* Special case for deprecated blocks not in sets */ + switch (type) + { + case CANONICAL: + if (usCollator.compare(blockName, "Surrogates Area") == 0) + return SURROGATES_AREA; + break; + case NO_SPACES: + if (usCollator.compare(blockName, "SurrogatesArea") == 0) + return SURROGATES_AREA; + break; + case CONSTANT: + if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) + return SURROGATES_AREA; + break; + } + /* Other cases */ + switch (type) + { + case CANONICAL: + for (UnicodeBlock block : sets) + if (usCollator.compare(blockName, block.canonicalName) == 0) + return block; + break; + case NO_SPACES: + for (UnicodeBlock block : sets) + { + String nsName = block.canonicalName.replaceAll(" ",""); + if (usCollator.compare(blockName, nsName) == 0) + return block; + } + break; + case CONSTANT: + for (UnicodeBlock block : sets) + if (usCollator.compare(blockName, block.toString()) == 0) + return block; + break; + } + throw new IllegalArgumentException("No Unicode block found for " + + blockName + "."); + } +EOF + +my @names = (); +while (<BLOCKS>) { + next if /^\#/; + my ($range, $block) = split(/; /); + my ($start, $end) = split /\.\./, $range; + next unless defined $block; + chomp $block; + $block =~ s/ *$//; + + # Translate new Unicode names which have the old name in Java + $block = "Greek" if $block =~ /Greek and Coptic/; + $block = "Combining Marks for Symbols" + if $block =~ /Combining Diacritical Marks for Symbols/; + + (my $name = $block) =~ tr/a-z -/A-Z__/; + push @names, $name; + my $since = (defined $additions{$name} + ? "\n * \@since $additions{$name}" : ""); + print <<EOF; + + /** + * $block. + * 0x$start - 0x$end.$since + */ + public static final UnicodeBlock $name + = new UnicodeBlock(0x$start, 0x$end, + "$name", + "$block"); +EOF +} + +print <<EOF; + + /** + * Surrogates Area. + * '\uD800' - '\uDFFF'. + * \@deprecated As of 1.5, the three areas, + * <a href="#HIGH_SURROGATES">HIGH_SURROGATES</a>, + * <a href="#HIGH_PRIVATE_USE_SURROGATES">HIGH_PRIVATE_USE_SURROGATES</a> + * and <a href="#LOW_SURROGATES">LOW_SURROGATES</a>, as defined + * by the Unicode standard, should be used in preference to + * this. These are also returned from calls to <code>of(int)</code> + * and <code>of(char)</code>. + */ + \@Deprecated + public static final UnicodeBlock SURROGATES_AREA + = new UnicodeBlock(0xD800, 0xDFFF, + "SURROGATES_AREA", + "Surrogates Area"); + + /** + * The defined subsets. + */ + private static final UnicodeBlock sets[] = { +EOF + +foreach (@names) { + print " $_,\n"; +} + +print <<EOF; + }; + } // class UnicodeBlock +EOF diff --git a/libjava/classpath/scripts/unicode-muncher.pl b/libjava/classpath/scripts/unicode-muncher.pl new file mode 100755 index 00000000000..db2b89a728c --- /dev/null +++ b/libjava/classpath/scripts/unicode-muncher.pl @@ -0,0 +1,868 @@ +#!/usr/bin/perl -w +# unicode-muncher.pl -- generate Unicode database for java.lang.Character +# Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc. +# +# This file is part of GNU Classpath. +# +# GNU Classpath is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Classpath is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Classpath; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +# Code for reading UnicodeData.txt and generating the code for +# gnu.java.lang.CharData. For now, the relevant Unicode definition files +# are found in doc/unicode/. +# +# Inspired by code from Jochen Hoenicke. +# author Eric Blake <ebb9@email.byu.edu> +# updated to Unicode 4.0.0 by Anthony Balkissoon <abalkiss@redhat.com> +# +# Usage: ./unicode-muncher <UnicodeData> <SpecialCasing> <CharData.java> +# where <UnicodeData> and <SpecialCasing> are .txt files obtained from +# www.unicode.org (named UnicodeData-4.0.0.txt and SpecialCasing-4.0.0.txt for +# Unicode version 4.0.0), and <CharData.java> is the final location for the +# Java interface gnu.java.lang.CharData. +# As of JDK 1.5, use Unicode version 4.0.0 for best results. + +## +## Convert a 16-bit integer to a Java source code String literal character +## +sub javaChar($) { + my ($char) = @_; + die "Out of range: $char\n" if $char < -0x8000 or $char > 0x10ffff; + $char += 0x10000 if $char < 0; + # Special case characters that must be escaped, or are shorter as ASCII + return sprintf("\\%03o", $char) if $char < 0x20; + return "\\\"" if $char == 0x22; + return "\\\\" if $char == 0x5c; + return pack("C", $char) if $char < 0x7f; + return sprintf("\\u%04x", $char); +} + +## +## Convert the text UnicodeData file from www.unicode.org into a Java +## interface with string constants holding the compressed information. +## +my @TYPECODES = qw(Cn Lu Ll Lt Lm Lo Mn Me Mc Nd Nl No Zs Zl Zp Cc Cf + SKIPPED Co Cs Pd Ps Pe Pc Po Sm Sc Sk So Pi Pf); +my @DIRCODES = qw(L R AL EN ES ET AN CS NSM BN B S WS ON LRE LRO RLE RLO PDF); + +my $NOBREAK_FLAG = 32; +my $MIRRORED_FLAG = 64; + +my %special = (); + +# infoArray is an array where each element is a list of character information +# for characters in a plane. The index of each list is equal to the plane +# that it corresponds to even though most of these lists will currently be +# empty. This is done so that that this script can be easily modified to +# accomodate future versions of Unicode. +my @infoArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); + +# info is a reference to one of the lists in infoArray, depending on which +# plane we're currently parsing. +my $info; + +# titlecase is a string of ordered pairs of characters to store the titlecase +# conversions of characters that have them +my $titlecase = ""; + +# count is simply used to print "." to the screen every so often +my $count = 0; + +# range is used when the UnicodeData file blocks out ranges of code points +my $range = 0; + +# largeNums is an array of numerical values that are too large to fit +# into the 16 bit char where most numerical values are stored. +# What is stored in the char then is a number N such that (-N - 3) is +# the index into largeNums where the numerical value can be found. +my @largeNums = (); + +die "Usage: $0 <UnicodeData.txt> <SpecialCasing.txt> <CharData.java>" + unless @ARGV == 3; +$| = 1; +print "GNU Classpath Unicode Attribute Database Generator 2.1\n"; +print "Copyright (C) 1998, 2002 Free Software Foundation, Inc.\n"; + +################################################################################ +################################################################################ +## Stage 0: Parse the special casing file +print "Parsing special casing file\n"; +open (SPECIAL, "< $ARGV[1]") || die "Can't open special casing file: $!\n"; +while (<SPECIAL>) { + next if /^\#/; + my ($ch, undef, undef, $upper) = split / *; */; + + # This grabs only the special casing for multi-char uppercase. Note that + # there are no multi-char lowercase, and that Sun ignores multi-char + # titlecase rules. This script omits 3 special cases in Unicode 3.0.0, + # which must be hardcoded in java.lang.String: + # \u03a3 (Sun ignores this special case) + # \u0049 - lowercases to \u0131, but only in Turkish locale + # \u0069 - uppercases to \u0130, but only in Turkish locale + next unless defined $upper and $upper =~ / /; + $special{hex $ch} = [map {hex} split ' ', $upper]; +} +close SPECIAL; + +################################################################################ +################################################################################ +## Stage 1: Parse the attribute file +print "Parsing attributes file"; +open (UNICODE, "< $ARGV[0]") || die "Can't open Unicode attribute file: $!\n"; +while (<UNICODE>) { + print "." unless $count++ % 1000; + chomp; + s/\r//g; + my ($ch, $name, $category, undef, $bidir, $decomp, undef, undef, $numeric, + $mirrored, undef, undef, $upcase, $lowcase, $title) = split ';'; + $ch = hex($ch); + + # plane tells us which Unicode code plane we're currently in and is an + # index into infoArray. + my $plane = int($ch / 0x10000); + my $planeBase = $plane * 0x10000; + $info = \@{$infoArray[$plane]}; + + my ($type, $numValue, $upperchar, $lowerchar, $direction); + + # Set the value of the $type variable, checking to make sure that it's valid + # and setting the mirrored and nobreak bits if necessary. + $type = 0; + while ($category !~ /^$TYPECODES[$type]$/) { + if (++$type == @TYPECODES) { + die "$ch: Unknown type: $category"; + } + } + $type |= $NOBREAK_FLAG if ($decomp =~ /noBreak/); + $type |= $MIRRORED_FLAG if ($mirrored =~ /Y/); + + # Set the value of the $numeric variable checking the special cases of + # large numbers or 'a' - 'z' values. + if ($numeric =~ /^[0-9]+$/) { + $numValue = $numeric; + # If numeric takes more than 16 bits to store we want to store that + # number in a separate array and store a number N in numValue such + # that (-N - 3) is the offset into the separate array containing the + # large numerical value. + if ($numValue >= 0x7fff) { + $numValue = -3 - @largeNums; + push @largeNums, $numeric; + } + } elsif ($numeric eq "") { + # Special case sequences of 'a'-'z' + if ($ch >= 0x0041 && $ch <= 0x005a) { + $numValue = $ch - 0x0037; + } elsif ($ch >= 0x0061 && $ch <= 0x007a) { + $numValue = $ch - 0x0057; + } elsif ($ch >= 0xff21 && $ch <= 0xff3a) { + $numValue = $ch - 0xff17; + } elsif ($ch >= 0xff41 && $ch <= 0xff5a) { + $numValue = $ch - 0xff37; + } else { + $numValue = -1; + } + } else { + $numValue = -2; + } + + # Set the uppercase and lowercase expansions for the character. + $upperchar = $upcase ? hex($upcase) - $ch : 0; + $lowerchar = $lowcase ? hex($lowcase) - $ch : 0; + + # If this character has a special titlecase expansion then append it to + # the titlecase String. + if ($title ne $upcase) { + my $titlechar = $title ? hex($title) : $ch; + $titlecase .= pack("n2", $ch, $titlechar); + } + + # Set the direction variable, use the lower 2 bits as a count of how many + # characters will be added to the String if this character undergoes an + # uppercase expansion. + $direction = 0; + while ($bidir !~ /^$DIRCODES[$direction]$/) { + if (++$direction == @DIRCODES) { + $direction = -1; + last; + } + } + $direction <<= 2; + $direction += $#{$special{$ch}} if defined $special{$ch}; + + # If the UnicodeData file blocks off ranges of code points give them all + # the same character information. + if ($range) { + die "Expecting end of range at $ch\n" unless $name =~ /Last>$/; + for ($range + 1 .. $ch - 1) { + $info->[$_ - $planeBase] = pack("n5", $type, $numValue, $upperchar, + $lowerchar, $direction); + } + $range = 0; + } elsif ($name =~ /First>$/) { + $range = $ch; + } + + # Store all this parsed information into the element in infoArray that info + # points to. + $info->[$ch - $planeBase] = pack("n5", $type, $numValue, $upperchar, $lowerchar, + $direction); +} +close UNICODE; + +################################################################################ +################################################################################ +## Stage 2: Compress the data structures +printf "\nCompressing data structures"; +$count = 0; + +# data is a String that will be used to create the DATA String containing +# character information and offsets into the attribute tables. +my @data = (); + +# charhashArray is an array of hashtables used so that we can reuse character +# attributes when characters share the same attributes ... this makes our +# attribute tables smaller. charhash is a pointer into this array. +my @charhashArray = ({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}); +my $charhash = (); + +# charinfoArray is an array of arrays, one per plane, for storing character +# information. charinfo is a pointer into this array. +my @charinfoArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); +my $charinfo; + +# charlen is an array, one element per plane, that tells us how many unique +# character attributes there are for that plane. +my @charlen = (); + +for my $plane (0 .. 0x10) { + $info = \@{$infoArray[$plane]}; + my $planeBase = $plane * 0x10000; + $charhash = \%{$charhashArray[$plane]}; + $charinfo = \@{$charinfoArray[$plane]}; + + for my $ch ($planeBase .. $planeBase + 0xffff) { + my $index = $ch - $planeBase; + print "." unless $count++ % 0x1000; + $info->[$index] = pack("n5", 0, -1, 0, 0, -4) unless defined $info->[$index]; + + my ($type, $numVal, $upper, $lower, $direction) = unpack("n5", $info->[$index]); + if (! exists $charhash->{$info->[$index]}) { + # If we entered this loop that means the character we're looking at + # now has attributes that are unique from those that we've looked + # at so far for this plane. So we push its attributes into charinfo + # and store in charhash the offset into charinfo where these + # attributes can later be found. + push @{$charinfo}, [ $numVal, $upper, $lower, $direction ]; + $charhash->{$info->[$index]} = @{$charinfo} - 1; + # When the file is generaged, the number we just stored in charhas + # will be the upper 9 bits in the DATA String that are an offset + # into the attribute tables. + } + $data[$plane] .= pack("n", ($charhash->{$info->[$index]} << 7) | $type); + } + $charlen[$plane] = scalar(@{$charinfoArray[$plane]}); +} + +# the shift that results in the best compression of the table. This is an array +# because different shifts are better for the different tables for each plane. +my @bestshift; + +# an initial guess. +my $bestest = 1000000; +my @bestblkstr; +my @blksize = (); + +for my $plane (0 .. 0x10) { + print "\n\nplane: $plane\n"; + print "Unique character entries: $charlen[$plane]\n"; + $bestest = 1000000; + for my $i (3 .. 8) { + my $blksize = 1 << $i; + my %blocks = (); + my @blkarray = (); + my ($j, $k); + print "shift: $i"; + + for ($j = 0; $j < 0x10000; $j += $blksize) { + my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize; + if (! exists $blocks{$blkkey}) { + push @blkarray, $blkkey; + $blocks{$blkkey} = $#blkarray; + } + } + + my $blknum = @blkarray; + my $blocklen = $blknum * $blksize; + printf " before %5d", $blocklen; + + # Now we try to pack the blkarray as tight as possible by finding matching + # heads and tails. + for ($j = $blksize - 1; $j > 0; $j--) { + my %tails = (); + for $k (0 .. $#blkarray) { + next unless defined $blkarray[$k]; + my $len = length $blkarray[$k]; + my $tail = substr $blkarray[$k], $len - $j * 2; + if (exists $tails{$tail}) { + push @{$tails{$tail}}, $k; + } else { + $tails{$tail} = [ $k ]; + } + } + + # tails are calculated, now calculate the heads and merge. + BLOCK: + for $k (0 .. $#blkarray) { + next unless defined $blkarray[$k]; + my $tomerge = $k; + while (1) { + my $head = substr($blkarray[$tomerge], 0, $j * 2); + my $entry = $tails{$head}; + next BLOCK unless defined $entry; + + my $other = shift @{$entry}; + if ($other == $tomerge) { + if (@{$entry}) { + push @{$entry}, $other; + $other = shift @{$entry}; + } else { + push @{$entry}, $other; + next BLOCK; + } + } + if (@{$entry} == 0) { + delete $tails{$head}; + } + + # a match was found + my $merge = $blkarray[$other] + . substr($blkarray[$tomerge], $j * 2); + $blocklen -= $j; + $blknum--; + + if ($other < $tomerge) { + $blkarray[$tomerge] = undef; + $blkarray[$other] = $merge; + my $len = length $merge; + my $tail = substr $merge, $len - $j * 2; + $tails{$tail} = [ map { $_ == $tomerge ? $other : $_ } + @{$tails{$tail}} ]; + next BLOCK; + } + $blkarray[$tomerge] = $merge; + $blkarray[$other] = undef; + } + } + } + my $blockstr; + for $k (0 .. $#blkarray) { + $blockstr .= $blkarray[$k] if defined $blkarray[$k]; + } + + die "Unexpected $blocklen" if length($blockstr) != 2 * $blocklen; + my $estimate = 2 * $blocklen + (0x20000 >> $i); + + printf " after merge %5d: %6d bytes\n", $blocklen, $estimate; + if ($estimate < $bestest) { + $bestest = $estimate; + $bestshift[$plane] = $i; + $bestblkstr[$plane] = $blockstr; + } + } + $blksize[$plane] = 1 << $bestshift[$plane]; + print "best shift: ", $bestshift[$plane]; + print " blksize: ", $blksize[$plane]; +} +my @blocksArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); + +for my $plane (0 .. 0x10) { + for (my $j = 0; $j < 0x10000; $j += $blksize[$plane]) { + my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize[$plane]; + my $index = index $bestblkstr[$plane], $blkkey; + while ($index & 1) { + die "not found: $j" if $index == -1; + $index = index $bestblkstr[$plane], $blkkey, $index + 1; + } + push @{$blocksArray[$plane]}, ($index / 2 - $j) & 0xffff; + } +} + +################################################################################ +################################################################################ +## Stage 3: Generate the file +for my $plane (0 .. 0x10) { + die "UTF-8 limit of blocks may be exceeded for plane $plane: " . scalar(@{$blocksArray[$plane]}) . "\n" + if @{$blocksArray[$plane]} > 0xffff / 3; + die "UTF-8 limit of data may be exceeded for plane $plane: " . length($bestblkstr[$plane]) . "\n" + if length($bestblkstr[$plane]) > 0xffff / 3; +} + +{ + print "\nGenerating $ARGV[2]."; + my ($i, $j); + + open OUTPUT, "> $ARGV[2]" or die "Failed creating output file: $!\n"; + print OUTPUT <<EOF; +/* gnu/java/lang/CharData -- Database for java.lang.Character Unicode info + Copyright (C) 2002 Free Software Foundation, Inc. + *** This file is generated by scripts/unicode-muncher.pl *** + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.java.lang; + +/** + * This contains the info about the unicode characters, that + * java.lang.Character needs. It is generated automatically from + * <code>$ARGV[0]</code> and + * <code>$ARGV[1]</code>, by some + * perl scripts. These Unicode definition files can be found on the + * <a href="http://www.unicode.org">http://www.unicode.org</a> website. + * JDK 1.5 uses Unicode version 4.0.0. + * + * The data is stored as string constants, but Character will convert these + * Strings to their respective <code>char[]</code> components. The fields + * are stored in arrays of 17 elements each, one element per Unicode plane. + * <code>BLOCKS</code> stores the offset of a block of 2<sup>SHIFT</sup> + * characters within <code>DATA</code>. The DATA field, in turn, stores + * information about each character in the low order bits, and an offset + * into the attribute tables <code>UPPER</code>, <code>LOWER</code>, + * <code>NUM_VALUE</code>, and <code>DIRECTION</code>. Notice that the + * attribute tables are much smaller than 0xffff entries; as many characters + * in Unicode share common attributes. Numbers that are too large to fit + * into NUM_VALUE as 16 bit chars are stored in LARGENUMS and a number N is + * stored in NUM_VALUE such that (-N - 3) is the offset into LARGENUMS for + * the particular character. The DIRECTION table also contains a field for + * detecting characters with multi-character uppercase expansions. + * Next, there is a listing for <code>TITLE</code> exceptions (most characters + * just have the same title case as upper case). Finally, there are two + * tables for multi-character capitalization, <code>UPPER_SPECIAL</code> + * which lists the characters which are special cased, and + * <code>UPPER_EXPAND</code>, which lists their expansion. + * + * \@author scripts/unicode-muncher.pl (written by Jochen Hoenicke, + * Eric Blake) + * \@see Character + * \@see String + */ +public interface CharData +{ + /** + * The Unicode definition file that was parsed to build this database. + */ + String SOURCE = \"$ARGV[0]\"; + + /** + * The character shift amount to look up the block offset. In other words, + * <code>(char) (BLOCKS.value[ch >> SHIFT[p]] + ch)</code> is the index + * where <code>ch</code> is described in <code>DATA</code> if <code>ch</code> + * is in Unicode plane <code>p</code>. Note that <code>p</code> is simply + * the integer division of ch and 0x10000. + */ + int[] SHIFT +EOF + for ($i = 0; $i < @bestshift - 1; $i++) { + if ($i == 0){ + print OUTPUT " = new int[] {"; + } + print OUTPUT $bestshift[$i], ", "; + } + if (scalar(@bestshift) > 0){ + print OUTPUT $bestshift[-1], "}"; + } + else { + print OUTPUT " = null"; + } + print OUTPUT <<EOF; +; + + /** + * The mapping of character blocks to their location in <code>DATA</code>. + * Each entry has been adjusted so that the 16-bit sum with the desired + * character gives the actual index into <code>DATA</code>. + */ + String[] BLOCKS = new String[]{ +EOF + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + for ($i = 0; $i < @{$blocksArray[$plane]} / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if @{$blocksArray[$plane]} <= $i * 11 + $j; + my $val = $blocksArray[$plane]->[$i * 11 + $j]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * The array containing the numeric values that are too large to be stored as + * chars in NUM_VALUE. NUM_VALUE in this case will contain a negative integer + * N such that LARGENUMS[-N - 3] contains the correct numeric value. + */ + int[] LARGENUMS +EOF + for ($i = 0; $i < @largeNums - 1; $i++) { + if ($i == 0){ + print OUTPUT " = new int[] {"; + } + print OUTPUT $largeNums[$i], ", "; + } + if (scalar(@largeNums) > 0){ + print OUTPUT $largeNums[-1], "}"; + } + else { + print OUTPUT " = null"; + } + print OUTPUT <<EOF; +; + + /** + * Information about each character. The low order 5 bits form the + * character type, the next bit is a flag for non-breaking spaces, and the + * next bit is a flag for mirrored directionality. The high order 9 bits + * form the offset into the attribute tables. Note that this limits the + * number of unique character attributes to 512, which is not a problem + * as of Unicode version 4.0.0, but may soon become one. + */ + String[] DATA = new String[]{ +EOF + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + my $len = length($bestblkstr[$plane]) / 2; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = unpack "n", substr($bestblkstr[$plane], 2 * ($i * 11 + $j), 2); + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * This is the attribute table for computing the numeric value of a + * character. The value is -1 if Unicode does not define a value, -2 + * if the value is not a positive integer, otherwise it is the value. + * Note that this is a signed value, but stored as an unsigned char + * since this is a String literal. + */ + String[] NUM_VALUE = new String[]{ +EOF + + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][0]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * This is the attribute table for computing the single-character uppercase + * representation of a character. The value is the signed difference + * between the character and its uppercase version. Note that this is + * stored as an unsigned char since this is a String literal. When + * capitalizing a String, you must first check if a multi-character uppercase + * sequence exists before using this character. + */ + String[] UPPER = new String[]{ +EOF + + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][1]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * This is the attribute table for computing the lowercase representation + * of a character. The value is the signed difference between the + * character and its lowercase version. Note that this is stored as an + * unsigned char since this is a String literal. + */ + String[] LOWER = new String[]{ +EOF + + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][2]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * This is the attribute table for computing the directionality class + * of a character, as well as a marker of characters with a multi-character + * capitalization. The direction is taken by performing a signed shift + * right by 2 (where a result of -1 means an unknown direction, such as + * for undefined characters). The lower 2 bits form a count of the + * additional characters that will be added to a String when performing + * multi-character uppercase expansion. This count is also used, along with + * the offset in UPPER_SPECIAL, to determine how much of UPPER_EXPAND to use + * when performing the case conversion. Note that this information is stored + * as an unsigned char since this is a String literal. + */ + String[] DIRECTION = new String[]{ +EOF + + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][3]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } + } + print OUTPUT <<EOF; +; + + /** + * This is the listing of titlecase special cases (all other characters + * can use <code>UPPER</code> to determine their titlecase). The listing + * is a sorted sequence of character pairs; converting the first character + * of the pair to titlecase produces the second character. + */ + String TITLE +EOF + + $len = length($titlecase) / 2; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + \"" : " = \""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = unpack "n", substr($titlecase, 2 * ($i * 11 + $j), 2); + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + + print OUTPUT <<EOF; +; + + /** + * This is a listing of characters with multi-character uppercase sequences. + * A character appears in this list exactly when it has a non-zero entry + * in the low-order 2-bit field of DIRECTION. The listing is a sorted + * sequence of pairs (hence a binary search on the even elements is an + * efficient way to lookup a character). The first element of a pair is the + * character with the expansion, and the second is the index into + * UPPER_EXPAND where the expansion begins. Use the 2-bit field of + * DIRECTION to determine where the expansion ends. + */ + String UPPER_SPECIAL +EOF + + my @list = sort {$a <=> $b} keys %special; + my $expansion = ""; + my $offset = 0; + $len = @list; + for ($i = 0; $i < $len / 5; $i++) { + print OUTPUT $i ? "\n + \"" : " = \""; + for $j (0 .. 4) { + last if $len <= $i * 5 + $j; + my $ch = $list[$i * 5 + $j]; + print OUTPUT javaChar($ch); + print OUTPUT javaChar($offset); + $offset += @{$special{$ch}}; + $expansion .= pack "n*", @{$special{$ch}}; + } + print OUTPUT "\""; + } + + print OUTPUT <<EOF; +; + + /** + * This is the listing of special case multi-character uppercase sequences. + * Characters listed in UPPER_SPECIAL index into this table to find their + * uppercase expansion. Remember that you must also perform special-casing + * on two single-character sequences in the Turkish locale, which are not + * covered here in CharData. + */ + String UPPER_EXPAND +EOF + + $len = length($expansion) / 2; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + \"" : " = \""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = unpack "n", substr($expansion, 2 * ($i * 11 + $j), 2); + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + + print OUTPUT ";\n}\n"; + close OUTPUT; +} +print "\nDone.\n"; |