diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-12-10 20:25:39 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-12-10 20:25:39 +0000 |
commit | da66af5951b18b6f5e8752cbbe11f5f842332a33 (patch) | |
tree | a28e126d1415e3689be6c7b2c2d061ae51194195 /scripts | |
parent | ab90923ee693a17e2e0e37b6ba5a84794c9236de (diff) | |
download | classpath-da66af5951b18b6f5e8752cbbe11f5f842332a33.tar.gz |
2006-12-10 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of generics-branch to HEAD (woohoo!)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/classpath.spec.in | 2 | ||||
-rwxr-xr-x | scripts/sanitize-jsr166 | 6 | ||||
-rwxr-xr-x | scripts/unicode-blocks.pl | 50 |
3 files changed, 27 insertions, 31 deletions
diff --git a/scripts/classpath.spec.in b/scripts/classpath.spec.in index 50e975d58..5363565bf 100644 --- a/scripts/classpath.spec.in +++ b/scripts/classpath.spec.in @@ -1,4 +1,4 @@ -# $Id: classpath.spec.in,v 1.2 2005-07-04 14:31:01 ziga Exp $ +# $Id: classpath.spec.in,v 1.3 2006-12-10 20:25:50 gnu_andrew Exp $ %define version_num @PACKAGE_VERSION@ %define release_num 1 diff --git a/scripts/sanitize-jsr166 b/scripts/sanitize-jsr166 new file mode 100755 index 000000000..d4ca8585b --- /dev/null +++ b/scripts/sanitize-jsr166 @@ -0,0 +1,6 @@ +#! /bin/sh + +# Sanitize a jsr166 download. + +# Remove code copyright Sun. +find . -name '*.java' -print | xargs grep -l 'Copyright.*Sun' | xargs rm diff --git a/scripts/unicode-blocks.pl b/scripts/unicode-blocks.pl index f022220ac..301cd1dd8 100755 --- a/scripts/unicode-blocks.pl +++ b/scripts/unicode-blocks.pl @@ -144,10 +144,8 @@ print <<'EOF'; /** The canonical name of the block according to the Unicode standard. */ private final String canonicalName; - /** Constants for the <code>forName()</code> method */ - private static final int CANONICAL_NAME = 0; - private static final int NO_SPACES_NAME = 1; - private static final int CONSTANT_NAME = 2; + /** Enumeration for the <code>forName()</code> method */ + private enum NameType { CANONICAL, NO_SPACES, CONSTANT; }; /** * Constructor for strictly defined blocks. @@ -248,59 +246,51 @@ print <<'EOF'; */ public static final UnicodeBlock forName(String blockName) { - int type; + NameType type; if (blockName.indexOf(' ') != -1) - type = CANONICAL_NAME; + type = NameType.CANONICAL; else if (blockName.indexOf('_') != -1) - type = CONSTANT_NAME; + type = NameType.CONSTANT; else - type = NO_SPACES_NAME; + type = NameType.NO_SPACES; Collator usCollator = Collator.getInstance(Locale.US); usCollator.setStrength(Collator.PRIMARY); /* Special case for deprecated blocks not in sets */ switch (type) { - case CANONICAL_NAME: + case CANONICAL: if (usCollator.compare(blockName, "Surrogates Area") == 0) return SURROGATES_AREA; break; - case NO_SPACES_NAME: + case NO_SPACES: if (usCollator.compare(blockName, "SurrogatesArea") == 0) return SURROGATES_AREA; break; - case CONSTANT_NAME: + case CONSTANT: if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) return SURROGATES_AREA; break; } /* Other cases */ - int setLength = sets.length; switch (type) { - case CANONICAL_NAME: - for (int i = 0; i < setLength; i++) - { - UnicodeBlock block = sets[i]; - if (usCollator.compare(blockName, block.canonicalName) == 0) - return block; - } + case CANONICAL: + for (UnicodeBlock block : sets) + if (usCollator.compare(blockName, block.canonicalName) == 0) + return block; break; - case NO_SPACES_NAME: - for (int i = 0; i < setLength; i++) - { - UnicodeBlock block = sets[i]; + case NO_SPACES: + for (UnicodeBlock block : sets) + { String nsName = block.canonicalName.replaceAll(" ",""); if (usCollator.compare(blockName, nsName) == 0) return block; } break; - case CONSTANT_NAME: - for (int i = 0; i < setLength; i++) - { - UnicodeBlock block = sets[i]; - if (usCollator.compare(blockName, block.toString()) == 0) - return block; - } + case CONSTANT: + for (UnicodeBlock block : sets) + if (usCollator.compare(blockName, block.toString()) == 0) + return block; break; } throw new IllegalArgumentException("No Unicode block found for " + |