Initial revision

From-SVN: r102074
This commit is contained in:
Tom Tromey
2005-07-16 00:30:23 +00:00
parent 6f4434b39b
commit f911ba985a
4557 changed files with 1000262 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
Makefile
Makefile.in
classpath.spec
+2
View File
@@ -0,0 +1,2 @@
EXTRA_DIST = check_jni_methods.sh generate-locale-list.sh
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
TMPFILE=check-jni-methods.$$.1
TMPFILE2=check-jni-methods.$$.2
TMPFILE3=check-jni-methods.$$.3
# Find all methods defined in the header files generated
# from the java source files.
grep -h '^JNIEXPORT .* Java_' include/*.h | \
LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' | \
sort > $TMPFILE
# Find all methods in the JNI C source files.
find native/jni -name \*.c | \
xargs grep -h '^Java_' | \
LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' | \
sort > $TMPFILE2
# Write temporary ignore file.
cat > $TMPFILE3 << EOF
-Java_gnu_java_awt_peer_gtk_GtkMenuComponentPeer_dispose
-Java_java_lang_VMSystem_arraycopy
-Java_java_lang_VMSystem_identityHashCode
EOF
# Compare again silently.
diff -ub -0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -q -v -f $TMPFILE3
RESULT=$?
if test "$RESULT" = "0" ; then
echo "Found a problem with the JNI methods declared and implemented."
echo "(-) missing in implementation, (+) missing in header files"
# Compare the found method lists.
diff -ub -0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -v -f $TMPFILE3
fi
# Cleanup.
rm -f $TMPFILE $TMPFILE2 $TMPFILE3
if test "$RESULT" = "0" ; then
exit 1
fi
exit 0
@@ -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>
@@ -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. \*/$
^ *$
@@ -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>
+42
View File
@@ -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;
}
@@ -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) &gt; 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) &gt; 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>
+68
View File
@@ -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
+17
View File
@@ -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
@@ -0,0 +1,66 @@
# $Id: classpath.spec.in,v 1.2 2005/07/04 14:31:01 ziga Exp $
%define version_num @PACKAGE_VERSION@
%define release_num 1
Summary: GNU Classpath Java class libraries
Name: classpath
Version: %{version_num}
Release: %{release_num}
Group: Development/Tools
Copyright: GPL+exception
URL: http://www.classpath.org/
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: jikes, zip
Packager: GNU Classpath <classpath@gnu.org>
Source: ftp://ftp.gnu.org/pub/gnu/classpath/classpath-%{version_num}.tar.gz
%description
GNU Classpath, Essential Libraries for Java, is a GNU project to create
free core class libraries for use with virtual machines and compilers
for the Java programming language.
%prep
%setup -n classpath-%{version_num}
%build
pushd ${RPM_BUILD_DIR}/classpath-%{version_num}
# Determine if we can build the GTK stuff
GTKPEER='disable'
if pkg-config --exists 'gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 gdk-pixbuf-2.0'; then
GTKPEER='enable'
fi
%configure --with-jikes --enable-jni --${GTKPEER}-gtk-peer
make
popd
%install
pushd ${RPM_BUILD_DIR}/classpath-%{version_num}
%{makeinstall}
popd
pushd ${RPM_BUILD_ROOT}/%{_infodir}
rm -f dir
for i in *; do
mv $i classpath-$i
done
popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc AUTHORS COPYING LICENSE README THANKYOU
%{_libdir}/classpath
%dir %{_datadir}/classpath
%{_libdir}/security/classpath.security
%{_datadir}/classpath/glibj.zip
%doc %{_datadir}/classpath/api
%doc %{_datadir}/classpath/examples
%doc %{_infodir}/*
+186
View File
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<profiles version="6">
<profile name="GNU" version="6">
<setting id="comment_clear_blank_lines" value="true"/>
<setting id="comment_format_comments" value="true"/>
<setting id="comment_format_header" value="false"/>
<setting id="comment_format_html" value="true"/>
<setting id="comment_format_source_code" value="true"/>
<setting id="comment_indent_parameter_description" value="true"/>
<setting id="comment_indent_root_tags" value="true"/>
<setting id="comment_line_length" value="80"/>
<setting id="comment_new_line_for_parameter" value="true"/>
<setting id="comment_separate_root_tags" value="true"/>
<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_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_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="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<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_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_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.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_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.insert_new_line_after_opening_brace_in_array_initializer" value="do not 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_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_assignment_operator" value="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_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_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_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_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_superinterfaces" value="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_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_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_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not 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_binary_operator" value="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_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_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_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_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_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_superinterfaces" value="do not 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_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_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_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_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_constructor_declaration" 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"/>
</profile>
</profiles>
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
CLASSPATH_SRCDIR=`dirname $0`/..
echo "/* LocaleData.java --"
echo " Copyright (C) 2004, 2005 Free Software Foundation, Inc."
echo
echo "This file is part of GNU Classpath."
echo
echo "GNU Classpath is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
echo "the Free Software Foundation; either version 2, or (at your option)"
echo "any later version."
echo
echo "GNU Classpath is distributed in the hope that it will be useful, but"
echo "WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU"
echo "General Public License for more details."
echo
echo "You should have received a copy of the GNU General Public License"
echo "along with GNU Classpath; see the file COPYING. If not, write to the"
echo "Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA"
echo "02110-1301 USA."
echo
echo "Linking this library statically or dynamically with other modules is"
echo "making a combined work based on this library. Thus, the terms and"
echo "conditions of the GNU General Public License cover the whole"
echo "combination."
echo
echo "As a special exception, the copyright holders of this library give you"
echo "permission to link this library with independent modules to produce an"
echo "executable, regardless of the license terms of these independent"
echo "modules, and to copy and distribute the resulting executable under"
echo "terms of your choice, provided that you also meet, for each linked"
echo "independent module, the terms and conditions of the license of that"
echo "module. An independent module is a module which is not derived from"
echo "or based on this library. If you modify this library, you may extend"
echo "this exception to your version of the library, but you are not"
echo "obligated to do so. If you do not wish to do so, delete this"
echo "exception statement from your version. */"
echo
echo
echo "package java.util;"
echo
echo "// This file was automatically generated by scripts/generate-locale-list.sh"
echo
echo
echo "class LocaleData"
echo "{"
echo " public static String[] localeNames ="
echo " {"
( cd $CLASSPATH_SRCDIR/resource/gnu/java/locale ; ls LocaleInformation_*.properties ) | xargs -n 1 echo | sed -e 's/LocaleInformation_\(.*\)\.properties/\1/' |
while read locale ; do echo " \"$locale\"," ; done
echo " };"
echo "}"
+378
View File
@@ -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>
+135
View File
@@ -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
+346
View File
@@ -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
+164
View File
@@ -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);
}
}
}
+366
View File
@@ -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 standard 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;
}
if ($6 =~ /[guz]/) {
$millis += $rawoffset;
} elsif ($6 =~ /w/) {
print STDERR "$timezonename not in standard time\n" if $stdoffset;
$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
timezones.put(\"$_\", tz);
EOF
}
}
+40
View File
@@ -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/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
+210
View File
@@ -0,0 +1,210 @@
#!/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",
);
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.4 uses Unicode version 3.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 char start;
/** The end of the subset. */
private final char end;
/**
* 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
*/
private UnicodeBlock(char start, char end, String name)
{
super(name);
this.start = start;
this.end = end;
}
/**
* Returns the Unicode character block which a character belongs to.
*
* @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)
{
// Special case, since SPECIALS contains two ranges.
if (ch == '\uFEFF')
return SPECIALS;
// 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 (ch < b.start)
hi = mid - 1;
else if (ch > b.end)
low = mid + 1;
else
return b;
}
return null;
}
EOF
my $seenSpecials = 0;
my $seenSurrogates = 0;
my $surrogateStart = 0;
my @names = ();
while (<BLOCKS>) {
next if /^\#/;
my ($start, $end, $block) = split(/; /);
next unless defined $block;
chomp $block;
$block =~ s/ *$//;
if (! $seenSpecials and $block =~ /Specials/) {
# Special case SPECIALS, since it is two disjoint ranges
$seenSpecials = 1;
next;
}
if ($block =~ /Surrogates/) {
# Special case SURROGATES_AREA, since it one range, not three
# consecutive, in Java
$seenSurrogates++;
if ($seenSurrogates == 1) {
$surrogateStart = $start;
next;
} elsif ($seenSurrogates == 2) {
next;
} else {
$start = $surrogateStart;
$block = "Surrogates Area";
}
}
# Special case the name of PRIVATE_USE_AREA.
$block =~ s/(Private Use)/$1 Area/;
(my $name = $block) =~ tr/a-z -/A-Z__/;
push @names, $name;
my $since = (defined $additions{$name}
? "\n * \@since $additions{$name}" : "");
my $extra = ($block =~ /Specials/ ? "'\\uFEFF', " : "");
print <<EOF;
/**
* $block.
* $extra'\\u$start' - '\\u$end'.$since
*/
public static final UnicodeBlock $name
= new UnicodeBlock('\\u$start', '\\u$end',
"$name");
EOF
}
print <<EOF;
/**
* The defined subsets.
*/
private static final UnicodeBlock sets[] = {
EOF
foreach (@names) {
print " $_,\n";
}
print <<EOF;
};
} // class UnicodeBlock
EOF
+639
View File
@@ -0,0 +1,639 @@
#!/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>
#
# Usage: ./unicode-muncher <UnicodeData> <SpecialCasing> <CharData.java>
# where <UnicodeData> and <SpecialCasing> are .txt files obtained from
# www.unicode.org (named UnicodeData-3.0.0.txt and SpecialCasing-2.txt for
# Unicode version 3.0.0), and <CharData.java> is the final location for the
# Java interface gnu.java.lang.CharData.
# As of JDK 1.4, use Unicode version 3.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 > 0xffff;
$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 = ();
my @info = ();
my $titlecase = "";
my $count = 0;
my $range = 0;
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);
next if $ch > 0xffff; # Ignore surrogate pairs, since Java does
my ($type, $numValue, $upperchar, $lowerchar, $direction);
$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/);
if ($numeric =~ /^[0-9]+$/) {
$numValue = $numeric;
die "numValue too big: $ch, $numValue\n" if $numValue >= 0x7fff;
} 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;
}
$upperchar = $upcase ? hex($upcase) - $ch : 0;
$lowerchar = $lowcase ? hex($lowcase) - $ch : 0;
if ($title ne $upcase) {
my $titlechar = $title ? hex($title) : $ch;
$titlecase .= pack("n2", $ch, $titlechar);
}
$direction = 0;
while ($bidir !~ /^$DIRCODES[$direction]$/) {
if (++$direction == @DIRCODES) {
$direction = -1;
last;
}
}
$direction <<= 2;
$direction += $#{$special{$ch}} if defined $special{$ch};
if ($range) {
die "Expecting end of range at $ch\n" unless $name =~ /Last>$/;
for ($range + 1 .. $ch - 1) {
$info[$_] = pack("n5", $type, $numValue, $upperchar,
$lowerchar, $direction);
}
$range = 0;
} elsif ($name =~ /First>$/) {
$range = $ch;
}
$info[$ch] = pack("n5", $type, $numValue, $upperchar, $lowerchar,
$direction);
}
close UNICODE;
# Stage 2: Compress the data structures
printf "\nCompressing data structures";
$count = 0;
my $info = ();
my %charhash = ();
my @charinfo = ();
for my $ch (0 .. 0xffff) {
print "." unless $count++ % 0x1000;
$info[$ch] = pack("n5", 0, -1, 0, 0, -4) unless defined $info[$ch];
my ($type, $numVal, $upper, $lower, $direction) = unpack("n5", $info[$ch]);
if (! exists $charhash{$info[$ch]}) {
push @charinfo, [ $numVal, $upper, $lower, $direction ];
$charhash{$info[$ch]} = $#charinfo;
}
$info .= pack("n", ($charhash{$info[$ch]} << 7) | $type);
}
my $charlen = @charinfo;
my $bestshift;
my $bestest = 1000000;
my $bestblkstr;
die "Too many unique character entries: $charlen\n" if $charlen > 512;
print "\nUnique character entries: $charlen\n";
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 $info, 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 = $i;
$bestblkstr = $blockstr;
}
}
my @blocks;
my $blksize = 1 << $bestshift;
for (my $j = 0; $j < 0x10000; $j += $blksize) {
my $blkkey = substr $info, 2 * $j, 2 * $blksize;
my $index = index $bestblkstr, $blkkey;
while ($index & 1) {
die "not found: $j" if $index == -1;
$index = index $bestblkstr, $blkkey, $index + 1;
}
push @blocks, ($index / 2 - $j) & 0xffff;
}
# Phase 3: Generate the file
die "UTF-8 limit of blocks may be exceeded: " . scalar(@blocks) . "\n"
if @blocks > 0xffff / 3;
die "UTF-8 limit of data may be exceeded: " . length($bestblkstr) . "\n"
if length($bestblkstr) > 0xffff / 3;
{
print "Generating $ARGV[2] with shift of $bestshift";
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.4 uses Unicode version 3.0.0.
*
* The data is stored as string constants, but Character will convert these
* Strings to their respective <code>char[]</code> components. The field
* <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. 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] + ch)</code> is the index where
* <code>ch</code> is described in <code>DATA</code>.
*/
int SHIFT = $bestshift;
/**
* 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
EOF
for ($i = 0; $i < @blocks / 11; $i++) {
print OUTPUT $i ? "\n + \"" : " = \"";
for $j (0 .. 10) {
last if @blocks <= $i * 11 + $j;
my $val = $blocks[$i * 11 + $j];
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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 3.2.0, but may soon become one.
*/
String DATA
EOF
my $len = length($bestblkstr) / 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($bestblkstr, 2 * ($i * 11 + $j), 2);
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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
EOF
$len = @charinfo;
for ($i = 0; $i < $len / 11; $i++) {
print OUTPUT $i ? "\n + \"" : " = \"";
for $j (0 .. 10) {
last if $len <= $i * 11 + $j;
my $val = $charinfo[$i * 11 + $j][0];
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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
EOF
$len = @charinfo;
for ($i = 0; $i < $len / 11; $i++) {
print OUTPUT $i ? "\n + \"" : " = \"";
for $j (0 .. 10) {
last if $len <= $i * 11 + $j;
my $val = $charinfo[$i * 11 + $j][1];
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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
EOF
$len = @charinfo;
for ($i = 0; $i < $len / 13; $i++) {
print OUTPUT $i ? "\n + \"" : " = \"";
for $j (0 .. 12) {
last if $len <= $i * 13 + $j;
my $val = $charinfo[$i * 13 + $j][2];
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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
EOF
$len = @charinfo;
for ($i = 0; $i < $len / 17; $i++) {
print OUTPUT $i ? "\n + \"" : " = \"";
for $j (0 .. 16) {
last if $len <= $i * 17 + $j;
my $val = $charinfo[$i * 17 + $j][3];
print OUTPUT javaChar($val);
}
print OUTPUT "\"";
}
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";