summaryrefslogtreecommitdiff
path: root/lib/mkcollections.pl.in
diff options
context:
space:
mode:
authorJochen Hoenicke <jochen@gnu.org>2001-03-05 10:16:45 +0000
committerJochen Hoenicke <jochen@gnu.org>2001-03-05 10:16:45 +0000
commit11aa6a4c5cb8cb25ad3858d47abdf18d87a58453 (patch)
tree614a212981622c6af8e006864734910104026d3d /lib/mkcollections.pl.in
parent034bd9e7702327d1798686520b3644edaf0ae5ce (diff)
downloadclasspath-11aa6a4c5cb8cb25ad3858d47abdf18d87a58453.tar.gz
* java/util/TreeMap.java (writeObject): Use defaultWriteObject()
instead of the new JDK1.2 API. This is simpler and makes back-porting the classes to JDK1.1 trivial. (readObject): likewise. * lib/mkcollections.pl.in (mymkdir): Give the permission parameter to mkdir. Simplified the method. (convert): Removed the hacks to convert the JDK1.2 api to 1.1, as they are no longer necessary.
Diffstat (limited to 'lib/mkcollections.pl.in')
-rwxr-xr-xlib/mkcollections.pl.in60
1 files changed, 15 insertions, 45 deletions
diff --git a/lib/mkcollections.pl.in b/lib/mkcollections.pl.in
index 5e0125bb5..ea34a39f2 100755
--- a/lib/mkcollections.pl.in
+++ b/lib/mkcollections.pl.in
@@ -33,7 +33,6 @@ my @javautilclasses=qw(AbstractCollection
ArrayList
Arrays
BasicMapEntry
- Bucket
List
Collection
Collections
@@ -63,15 +62,20 @@ my %imports = ( "Collections" => [ "Enumeration" ],
"Vector" => [ "Enumeration" ]);
-sub mymkdir ($) {
+sub mymkdir ($)
+ {
my ($dir) = @_;
- $dir =~ /^(.*)\/\w+$/ and
- $dir = "$1";
- if (! (-d "$dir")) {
- my $ret = mkdir ("$dir");
- if (!($ret)) { mymkdir ("$dir"); mkdir ("$dir"); }
- }
-}
+ if ($dir =~ /^(.*)\/\w+$/)
+ {
+ $parentdir = "$1";
+ if (! (-d $parentdir))
+ {
+ mymkdir ($parentdir);
+ }
+ }
+ print "$dir";
+ mkdir ($dir, 0777);
+ }
sub convert($$$) {
my ($file, $infile, $outfile) = @_;
@@ -81,9 +85,8 @@ sub convert($$$) {
my $dir = "$outfile";
$dir =~ /^(.*)\/\S+\.java$/ and
$dir = "$1";
- if (! (-d "$dir")) {
- my $ret = mkdir("$dir");
- if (!($ret)) { mymkdir ("$dir"); mkdir ("$dir"); }
+ if (! (-d $dir)) {
+ mymkdir ($dir);
}
open (OUTPUT, ">$outfile") || die "Could not open ", $outfile, " for writing\n";
@@ -107,39 +110,6 @@ EOF
$_ =~ s/abstract (interface)/$1/g;
- if ($file eq "ArrayList") {
- # ArrayList makes heavy use of PutField/GetField.
- # change it.
- $_ =~ s/_iSize/size/g;
- $_ =~ s/_arData/data/g;
- }
- if ($file eq "TreeMap") {
- $_ =~ s/_oComparator/comparator/g;
- $_ =~ s/(RBNode _oRoot|int _iSize|int _iModCount)/transient $1/;
- }
- if ($file eq "Vector") {
- $_ =~ s/(\s+)return (\w+)\.delete\((.*), x\)\./$1$2.setLength($3);\n${1}return $2./g;
- }
-
- if ($file eq "ArrayList"
- || $file eq "TreeMap"
- || $file eq "Hashtable") {
- if ($_ =~ /serialPersistentFields/) {
- $_ = <INPUT> while !($_ =~ /\}/);
- next;
- }
-
- $_ =~ /^(\s+)(.*\W)?(\w+).readFields/ and
- $_ = "$1$3.defaultReadObject();\n";
- $_ =~ /^(\s+)(.*\W)?(\w+).writeFields/ and
- $_ = "$1$3.defaultWriteObject();\n";
-
- if ($_ =~ /[io]Fields/) {
- $_ = <INPUT> while !($_ =~ /;/);
- next;
- }
- }
-
print OUTPUT $_;
if ($_ =~ /^package $destPkg;$/
&& exists $imports{$file}) {