1#!/usr/bin/env perl -p
2
3# Hide some symbols
4s!public (class db_java|[^(]* delete|[^(]* [A-Za-z_]*0\()!/* package */ $1!;
5
6# Mark methods that don't throw exceptions
7s!public [^(]*get_version_[a-z]*\([^)]*\)!$& /* no exception */!;
8s!public [^(]*[ _]err[a-z_]*\([^)]*\)!$& /* no exception */!;
9s!public [^(]*[ _]msg[a-z_]*\([^)]*\)!$& /* no exception */!;
10s!public [^(]*[ _]message[a-z_]*\([^)]*\)!$& /* no exception */!;
11s!public [^(]*[ _]strerror\([^)]*\)!$& /* no exception */!;
12s!public [^(]*log_compare\([^)]*\)!$& /* no exception */!;
13s!public [^(]* feedback\([^)]*\)!$& /* no exception */!;
14
15# Mark methods that throw special exceptions
16m/DbSequence/ || s!(public [^(]*(open|remove|rename)0?\([^)]*\))( {|;)!$1 throws com.sleepycat.db.DatabaseException, java.io.FileNotFoundException$3!;
17
18# Everything else throws a DbException
19s!(public [^(]*\([^)]*\))(;| {)!$1 throws com.sleepycat.db.DatabaseException$2!;
20
21# Add initialize methods for Java parts of Db and DbEnv
22s!\.new_DbEnv\(.*$!$&\n    initialize();!;
23s!\.new_Db\(.*$!$&\n    initialize(dbenv);!;
24