File: java-post.pl

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 158,620 kB
  • sloc: ansic: 448,573; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,600; perl: 14,557; xml: 10,799; makefile: 4,030; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (23 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl -p

# Hide some symbols
s!public (class db_java|[^(]* delete|[^(]* [A-Za-z_]*0\()!/* package */ $1!;

# Mark methods that don't throw exceptions
s!public [^(]*get_version_[a-z_]*\([^)]*\)!$& /* no exception */!;
s!public [^(]*[ _]err[a-z_]*\([^)]*\)!$& /* no exception */!;
s!public [^(]*[ _]msg[a-z_]*\([^)]*\)!$& /* no exception */!;
s!public [^(]*[ _]message[a-z_]*\([^)]*\)!$& /* no exception */!;
s!public [^(]*[ _]strerror\([^)]*\)!$& /* no exception */!;
s!public [^(]*log_compare\([^)]*\)!$& /* no exception */!;
s!public [^(]* feedback\([^)]*\)!$& /* no exception */!;

# Mark methods that throw special exceptions
m/DbSequence/ || s!(public [^(]*(open|remove|rename)0?\([^)]*\))( {|;)!$1 throws com.sleepycat.db.DatabaseException, java.io.FileNotFoundException$3!;

# Everything else throws a DbException
s!(public [^(]*\([^)]*\))(;| {)!$1 throws com.sleepycat.db.DatabaseException$2!;

# Add initialize methods for Java parts of Db and DbEnv
s!\.new_DbEnv\(.*$!$&\n    initialize();!;
s!\.new_Db\(.*$!$&\n    initialize(dbenv);!;