├── README ├── INSTALL ├── doc ├── Descriptor.html ├── Options.html ├── Changes.html └── Readme.html ├── Makefile.pl └── LICENSE /README: -------------------------------------------------------------------------------- 1 | NAME: 2 | Java API Compliance Checker (Java ACC) - a tool for checking backward binary and source-level compatibility of a Java library API. 3 | 4 | INSTALL: 5 | sudo perl Makefile.pl -install --prefix=/usr 6 | 7 | USAGE: 8 | japi-compliance-checker OLD.jar NEW.jar 9 | 10 | ADV. USAGE: 11 | For advanced usage, see doc/Readme.html or output of --help option. -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | 2 | Copyright (C) 2011 Institute for System Programming, RAS 3 | Copyright (C) 2011-2014 ROSA Laboratory 4 | Copyright (C) 2014-2015 Andrey Ponomarenko's ABI laboratory 5 | 6 | All rights reserved. 7 | 8 | 9 | RELEASE INFORMATION 10 | 11 | Project: Java API Compliance Checker (Java ACC) 12 | Version: 1.4.1 13 | Date: 2015-03-03 14 | 15 | 16 | This file explains how to install and setup environment 17 | for the tool in your computer. 18 | 19 | 20 | Content: 21 | 22 | 1. Requirements for Linux, FreeBSD and Mac OS X 23 | 2. Requirements for MS Windows 24 | 3. Configuring and Installing 25 | 4. Running the Tool 26 | 5. Advanced Usage 27 | 28 | 29 | 1. REQUIREMENTS FOR LINUX, FREEBSD and MAC OS X 30 | =============================================== 31 | 32 | 1. JDK<=1.8 (javap, javac) - development files 33 | 2. Perl 5 (5.8 or newer) 34 | 35 | 36 | 37 | 2. REQUIREMENTS FOR MS WINDOWS 38 | ============================== 39 | 40 | 1. JDK<=1.8 (javap, javac) 41 | 2. Active Perl 5 (5.8 or newer) 42 | 43 | 44 | 45 | 3. CONFIGURING AND INSTALLING 46 | ============================= 47 | 48 | This command will install an japi-compliance-checker program in the 49 | PREFIX/bin system directory: 50 | 51 | sudo perl Makefile.pl -install --prefix=PREFIX [/usr, /usr/local, ...] 52 | 53 | 3.1 Update 54 | 55 | sudo perl Makefile.pl -update --prefix=PREFIX 56 | 57 | 3.2 Remove 58 | 59 | sudo perl Makefile.pl -remove --prefix=PREFIX 60 | 61 | 62 | 63 | 4. RUNNING THE TOOL 64 | =================== 65 | 66 | 1. japi-compliance-checker OLD.jar NEW.jar 67 | 68 | 69 | 70 | 5. ADVANCED USAGE 71 | =================== 72 | 1. Create XML-descriptors for two versions 73 | of a library (OLD.xml and NEW.xml): 74 | 75 | 1.0 76 | 77 | 78 | 79 | /path1/to/JAR(s)/ 80 | /path2/to/JAR(s)/ 81 | ... 82 | 83 | 84 | 2. japi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml 85 | 3. For more advanced usage, see doc/Readme.html 86 | 87 | 88 | 89 | Enjoy! 90 | -------------------------------------------------------------------------------- /doc/Descriptor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Java Library Descriptor 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 30 | 31 | 32 |
33 |
34 | 35 | 36 |

Java Library Descriptor

37 |
38 |
39 |
40 | 41 | 42 |

Java library descriptor is a simple XML-file that specifies version number, paths to Java ARchives and optionally some other information. 43 |

44 |

Primary Sections

45 |
 <version>
 46 |      /* Version of the library */
 47 |  </version>
 48 |  
 49 |  <archives>
 50 |      /* The list of paths to Java ARchives and/or
 51 |         directories with archives, one per line */
 52 |  </archives>
 53 | 
54 |

Optional Sections

55 |
 <skip_packages>
 56 |      /* The list of packages, that
 57 |         should not be checked, one per line */
 58 |  </skip_packages>
 59 |  
 60 |  <packages>
 61 |      /* The list of packages, that
 62 |         should be checked, one per line.
 63 |         Other packages will not be checked. */
 64 |  </packages>
 65 | 
66 |

Examples

67 |
  • JDO 68 |
69 |
 <version>
 70 |      2.2
 71 |  </version>
 72 |  
 73 |  <archives>
 74 |      installed/jdo/2.2/jdo2-api-2.2.jar
 75 |  </archives>
 76 | 
77 |
  • JDK 78 |
79 |
 <version>
 80 |      1.6.0
 81 |  </version>
 82 |  
 83 |  <archives>
 84 |      installed/jdk/1.6.0/jre/lib/jsse.jar
 85 |      installed/jdk/1.6.0/jre/lib/jce.jar
 86 |      installed/jdk/1.6.0/jre/lib/rt.jar
 87 |  </archives>
 88 | 
89 |
  • Jackrabbit 90 |
91 |
 <version>
 92 |      2.2.8
 93 |  </version>
 94 |  
 95 |  <archives>
 96 |      installed/jackrabbit/2.2.8/jackrabbit-standalone-2.2.8.jar
 97 |  </archives>
 98 |  
 99 |  <skip_packages>
100 |      org.apache.jackrabbit.core
101 |      org.apache.jackrabbit.standalone.cli.core
102 |      org.apache.jackrabbit.test
103 |      x2006.main
104 |  </skip_packages>
105 |  
106 |  <packages>
107 |      org.apache.jackrabbit
108 |      org.apache.jcr
109 |  </packages>
110 | 
111 | 118 | 119 | 120 |
-------------------------------------------------------------------------------- /Makefile.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | ########################################################################### 3 | # Makefile for Java API Compliance Checker 4 | # Install/remove the tool for GNU/Linux, FreeBSD and Mac OS X 5 | # 6 | # Copyright (C) 2011 Russian Linux Verification Center 7 | # Copyright (C) 2011-2014 ROSA Laboratory 8 | # 9 | # Written by Andrey Ponomarenko 10 | # 11 | # This program is free software: you can redistribute it and/or modify 12 | # it under the terms of the GNU General Public License or the GNU Lesser 13 | # General Public License as published by the Free Software Foundation. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # and the GNU Lesser General Public License along with this program. 22 | # If not, see . 23 | ########################################################################### 24 | use Getopt::Long; 25 | Getopt::Long::Configure ("posix_default", "no_ignore_case"); 26 | use File::Path qw(mkpath rmtree); 27 | use File::Spec qw(catfile file_name_is_absolute); 28 | use File::Copy qw(copy); 29 | use File::Basename qw(dirname); 30 | use Cwd qw(abs_path); 31 | use File::Find; 32 | use Config; 33 | use strict; 34 | 35 | my $TOOL_SNAME = "japi-compliance-checker"; 36 | my $ARCHIVE_DIR = abs_path(dirname($0)); 37 | 38 | my $HELP_MSG = " 39 | NAME: 40 | Makefile for Java API Compliance Checker 41 | 42 | DESCRIPTION: 43 | Install $TOOL_SNAME command and private modules. 44 | 45 | USAGE: 46 | sudo perl $0 -install -prefix /usr 47 | sudo perl $0 -update -prefix /usr 48 | sudo perl $0 -remove -prefix /usr 49 | 50 | OPTIONS: 51 | -h|-help 52 | Print this help. 53 | 54 | --prefix=PREFIX 55 | Install files in PREFIX [/usr/local]. 56 | 57 | -install 58 | Command to install the tool. 59 | 60 | -update 61 | Command to update existing installation. 62 | 63 | -remove 64 | Command to remove the tool. 65 | 66 | EXTRA OPTIONS: 67 | --destdir=DESTDIR 68 | This option is for maintainers to build 69 | RPM or DEB packages inside the build root. 70 | The environment variable DESTDIR is also 71 | supported. 72 | \n"; 73 | 74 | if(not @ARGV) 75 | { 76 | print $HELP_MSG; 77 | exit(0); 78 | } 79 | 80 | my ($PREFIX, $DESTDIR, $Help, $Install, $Update, $Remove); 81 | 82 | GetOptions( 83 | "h|help!" => \$Help, 84 | "prefix=s" => \$PREFIX, 85 | "destdir=s" => \$DESTDIR, 86 | "install!" => \$Install, 87 | "update!" => \$Update, 88 | "remove!" => \$Remove 89 | ) or exit(1); 90 | 91 | sub scenario() 92 | { 93 | if($Help) 94 | { 95 | print $HELP_MSG; 96 | exit(0); 97 | } 98 | if(not $Install and not $Update and not $Remove) 99 | { 100 | print STDERR "ERROR: command is not selected (-install, -update or -remove)\n"; 101 | exit(1); 102 | } 103 | if($PREFIX ne "/") { 104 | $PREFIX=~s/[\/]+\Z//g; 105 | } 106 | if(not $PREFIX) 107 | { # default prefix 108 | if($Config{"osname"}!~/win/i) { 109 | $PREFIX = "/usr/local"; 110 | } 111 | } 112 | if(my $Var = $ENV{"DESTDIR"}) 113 | { 114 | print "Using DESTDIR environment variable\n"; 115 | $DESTDIR = $Var; 116 | } 117 | if($DESTDIR) 118 | { 119 | if($DESTDIR ne "/") { 120 | $DESTDIR=~s/[\/]+\Z//g; 121 | } 122 | if(not isAbs($DESTDIR)) 123 | { 124 | print STDERR "ERROR: destdir is not absolute path\n"; 125 | exit(1); 126 | } 127 | if(not -d $DESTDIR) 128 | { 129 | print STDERR "ERROR: you should create destdir directory first\n"; 130 | exit(1); 131 | } 132 | $PREFIX = $DESTDIR.$PREFIX; 133 | if(not -d $PREFIX) 134 | { 135 | print STDERR "ERROR: you should create installation directory first (destdir + prefix):\n mkdir -p $PREFIX\n"; 136 | exit(1); 137 | } 138 | } 139 | else 140 | { 141 | if(not isAbs($PREFIX)) 142 | { 143 | print STDERR "ERROR: prefix is not absolute path\n"; 144 | exit(1); 145 | } 146 | if(not -d $PREFIX) 147 | { 148 | print STDERR "ERROR: you should create prefix directory first\n"; 149 | exit(1); 150 | } 151 | } 152 | 153 | print "INSTALL PREFIX: $PREFIX\n"; 154 | 155 | # paths 156 | my $EXE_PATH = catFile($PREFIX, "bin"); 157 | my $MODULES_PATH = catFile($PREFIX, "share", $TOOL_SNAME); 158 | my $REL_PATH = catFile("..", "share", $TOOL_SNAME); 159 | my $TOOL_PATH = catFile($EXE_PATH, $TOOL_SNAME); 160 | 161 | if(not -w $PREFIX) 162 | { 163 | print STDERR "ERROR: you should be root\n"; 164 | exit(1); 165 | } 166 | if($Remove or $Update) 167 | { 168 | if(-e $EXE_PATH."/".$TOOL_SNAME) 169 | { # remove executable 170 | print "-- Removing $TOOL_PATH\n"; 171 | unlink($EXE_PATH."/".$TOOL_SNAME); 172 | } 173 | 174 | if(-d $MODULES_PATH) 175 | { # remove modules 176 | print "-- Removing $MODULES_PATH\n"; 177 | rmtree($MODULES_PATH); 178 | } 179 | } 180 | if($Install or $Update) 181 | { 182 | if(-e $EXE_PATH."/".$TOOL_SNAME or -e $MODULES_PATH) 183 | { # check installed 184 | if(not $Remove) 185 | { 186 | print STDERR "ERROR: you should remove old version first (`perl $0 -remove --prefix=$PREFIX`)\n"; 187 | exit(1); 188 | } 189 | } 190 | 191 | # configure 192 | my $Content = readFile($ARCHIVE_DIR."/".$TOOL_SNAME.".pl"); 193 | if($DESTDIR) { # relative path 194 | $Content=~s/MODULES_INSTALL_PATH/$REL_PATH/; 195 | } 196 | else { # absolute path 197 | $Content=~s/MODULES_INSTALL_PATH/$MODULES_PATH/; 198 | } 199 | 200 | # copy executable 201 | print "-- Installing $TOOL_PATH\n"; 202 | mkpath($EXE_PATH); 203 | writeFile($EXE_PATH."/".$TOOL_SNAME, $Content); 204 | chmod(0775, $EXE_PATH."/".$TOOL_SNAME); 205 | 206 | if($Config{"osname"}=~/win/i) { 207 | writeFile($EXE_PATH."/".$TOOL_SNAME.".cmd", "\@perl \"$TOOL_PATH\" \%*"); 208 | } 209 | 210 | # copy modules 211 | if(-d $ARCHIVE_DIR."/modules") 212 | { 213 | print "-- Installing $MODULES_PATH\n"; 214 | mkpath($MODULES_PATH); 215 | copyDir($ARCHIVE_DIR."/modules", $MODULES_PATH); 216 | } 217 | 218 | # check PATH 219 | my $Warn = "WARNING: your PATH variable doesn't include \'$EXE_PATH\'\n"; 220 | 221 | if($Config{"osname"}=~/win/i) 222 | { 223 | if($ENV{"PATH"}!~/(\A|[:;])\Q$EXE_PATH\E[\/\\]?(\Z|[:;])/i) { 224 | print $Warn; 225 | } 226 | } 227 | else 228 | { 229 | if($ENV{"PATH"}!~/(\A|[:;])\Q$EXE_PATH\E[\/\\]?(\Z|[:;])/) { 230 | print $Warn; 231 | } 232 | } 233 | } 234 | exit(0); 235 | } 236 | 237 | sub catFile(@) { 238 | return File::Spec->catfile(@_); 239 | } 240 | 241 | sub isAbs($) { 242 | return File::Spec->file_name_is_absolute($_[0]); 243 | } 244 | 245 | sub copyDir($$) 246 | { 247 | my ($From, $To) = @_; 248 | my %Files; 249 | find(\&wanted, $From); 250 | sub wanted { 251 | $Files{$File::Find::dir."/$_"} = 1 if($_ ne "."); 252 | } 253 | foreach my $Path (sort keys(%Files)) 254 | { 255 | my $Inst = $Path; 256 | $Inst=~s/\A\Q$ARCHIVE_DIR\E/$To/; 257 | if(-d $Path) 258 | { # directories 259 | mkpath($Inst); 260 | } 261 | else 262 | { # files 263 | mkpath(dirname($Inst)); 264 | copy($Path, $Inst); 265 | } 266 | } 267 | } 268 | 269 | sub readFile($) 270 | { 271 | my $Path = $_[0]; 272 | return "" if(not $Path or not -f $Path); 273 | open(FILE, $Path) || die ("can't open file \'$Path\': $!\n"); 274 | local $/ = undef; 275 | my $Content = ; 276 | close(FILE); 277 | return $Content; 278 | } 279 | 280 | sub writeFile($$) 281 | { 282 | my ($Path, $Content) = @_; 283 | return if(not $Path); 284 | open(FILE, ">".$Path) || die ("can't open file \'$Path\': $!\n"); 285 | print FILE $Content; 286 | close(FILE); 287 | } 288 | 289 | scenario(); -------------------------------------------------------------------------------- /doc/Options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Java API Compliance Checker Options 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 30 | 31 | 32 |
33 |
34 | 35 | 36 |

Java API Compliance Checker Options

37 |
38 |
39 |
40 | 41 | 42 |

Contents

43 | 49 |
50 |

Information Options

51 |
  • -h|-help 52 |
53 |
Print help message.

54 |
  • -v|-version 55 |
56 |
Print version information.

57 |
  • -dumpversion 58 |
59 |
Print the tool version and don't do anything else.

60 |

General Options

61 |
  • -l|-lib|-library NAME 62 |
63 |
Library name (without version). It affects only on the path and the title of the report.

64 |
  • -d1|-old|-o PATH 65 |
66 |
Path to the Java ARchive or XML-descriptor of 1st (old) library version.

67 |
  • -d2|-new|-n PATH 68 |
69 |
Path to the Java ARchive or XML-descriptor of 2nd (new) library version.

70 |

Extra Options

71 |
  • -client|-app PATH 72 |
73 |
This option allows to specify the client Java ARchive that should be checked for portability to the newer library version.

74 |
  • -binary 75 |
76 |
Show "Binary" compatibility problems only. Generate report to "bin_compat_report.html" file.

77 |
  • -source 78 |
79 |
Show "Source" compatibility problems only. Generate report to "src_compat_report.html" file.

80 |
  • -check-implementation 81 |
82 |
Compare implementation code (method's body) of Java classes. Add "Changes in Implementation" section to the report.

83 |
  • -v1|-version1 NUM 84 |
85 |
Specify 1st library version outside the descriptor.

86 |
  • -v2|-version2 NUM 87 |
88 |
Specify 2nd library version outside the descriptor.

89 |
  • -s|-strict 90 |
91 |
Treat all compatibility warnings as problems.

92 |
  • -keep-internal 93 |
94 |
Do not skip checking of these packages: *impl*, *internal*, *examples*, *com.oracle*, *com.sun*, *COM.rsa*, *sun*, *sunw*

95 |
  • -skip-internal PATTERN 96 |
97 |
Do not check internal packages matched by the pattern.

98 |
  • -dump|-dump-api PATH 99 |
100 |
Create library API dump for the input descriptor. You can transfer it anywhere and pass instead of the descriptor. Also it may be used for debugging the tool.

101 |
  • -classes-list PATH 102 |
103 |
This option allows to specify a file with a list of classes that should be checked, other classes will not be checked.

104 |
  • -skip-deprecated 105 |
106 |
Skip analysis of deprecated methods and classes.

107 |
  • -skip-classes PATH 108 |
109 |
This option allows to specify a file with a list of classes that should not be checked.

110 |
  • -d|-template 111 |
112 |
Create XML descriptor template ./VERSION.xml

113 |
  • -report-path PATH 114 |
115 |
Path to compatibility report. Default: compat_reports/LIB_NAME/V1_to_V2/compat_report.html

116 |
  • -bin-report-path PATH 117 |
118 |
Path to "Binary" compatibility report. Default: compat_reports/LIB_NAME/V1_to_V2/bin_compat_report.html

119 |
  • -src-report-path PATH 120 |
121 |
Path to "Source" compatibility report. Default: compat_reports/LIB_NAME/V1_to_V2/src_compat_report.html

122 |
  • -quick 123 |
124 |
Quick analysis. Disabled: 1) analysis of method parameter names, 2) analysis of class field values, 3) analysis of usage of added abstract methods.

125 |
  • -sort 126 |
127 |
Enable sorting of data in API dumps.

128 |
  • -show-access 129 |
130 |
Show access level of non-public methods listed in the report.

131 |
  • -limit-affected LIMIT 132 |
133 |
The maximum number of affected methods listed under the description of the changed type in the report.

134 |

Other Options

135 |
  • -test 136 |
137 |
Create two incompatible versions of a sample library and run the tool to check them for compatibility. This option allows to check if the tool works correctly in the current environment.

138 |
  • -debug 139 |
140 |
Debugging mode. Print debug info on the screen. Save intermediate analysis stages in the debug directory: debug/LIB_NAME/VER/. Also consider using --dump option for debugging the tool.

141 |
  • -l-full|-lib-full NAME 142 |
143 |
Change library name in the report title to NAME. By default will be displayed a name specified by -l option.

144 |
  • -b|-browse PROGRAM 145 |
146 |
Open report(s) in the browser (firefox, opera, etc.).

147 |
  • -open 148 |
149 |
Open report(s) in the default browser.

150 |
  • -jdk-path PATH 151 |
152 |
Path to the JDK install tree (e.g. /usr/lib/jvm/java-7-openjdk-amd64).

153 | 154 | 161 | 162 | 163 |
-------------------------------------------------------------------------------- /doc/Changes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Java API Compliance Checker - Change Log 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 30 | 31 | 32 |
33 |
34 | 35 | 36 |

Java API Compliance Checker - Change Log

37 |
38 |
39 |
40 | 41 | 42 |

Contents

43 | 53 |
54 |

Version 1.3.7 (April 25, 2014)

55 |

japi-compliance-checker-1.3.7.tar.gz
56 | This is a bug-fix release with a few new features. 57 |

58 |
  • New Features 59 |
    • Show Java version in the report summary 60 |
    • Marked deprecated methods in the report 61 |
    62 |
63 | 68 |
  • Bug Fixes 69 |
    • Improved support for Java 7 templates 70 |
    71 |
72 |
  • Other 73 |
    • Code cleaning 74 |
    75 |
76 |

Version 1.3.6 (January 21, 2014)

77 |

japi-compliance-checker-1.3.6.tar.gz
78 | This is a bug-fix release with a few new features. 79 |

80 |
  • Improvements 81 |
    • Support for Java 7 82 |
    83 |
84 | 88 |
  • Bug Fixes 89 |
    • Corrected formatting of output html reports 90 |
    • Fixed issue #7: "The command line is too long" 91 |
    • Improved performance on large input objects (30%) 92 |
    • Fixed issue #8: "-client option doesn't work" 93 |
    94 |
95 |
  • Other 96 |
    • Code cleaning 97 |
    • Corrected Makefile 98 |
    99 |
100 |

Version 1.2.1 (October 09, 2012)

101 |

japi-compliance-checker-1.2.1.tar.gz
102 | This is a bug-fix release with a few new features. 103 |

104 | 108 |
  • Bug Fixes 109 | 111 |
112 |

Version 1.2 (September 22, 2012)

113 |

japi-compliance-checker-1.2.tar.gz
114 | This is a bug-fix release with a few new features. 115 |

116 | 121 |
  • Bug Fixes 122 |
    • Fixed an issue with spaces in the execution path 123 |
    124 |
125 |
  • Other 126 |
    • Code cleaning 127 |
    128 |
129 |

Version 1.1.2 (June 08, 2012)

130 |

japi-compliance-checker-1.1.2.tar.gz
131 | This is a bug-fix release with a few new features. 132 |

133 | 138 |
  • Bug Fixes 139 |
    • Fixed an issue with -classes-list option 140 |
    • Fixed an issue with spaces in the path to javap and other commands 141 |
    • Fixed an issue with escaping of inner class specifier 142 |
    143 |
144 |
  • Other 145 |
    • Code cleaning 146 |
    147 |
148 |

Version 1.1 (April 16, 2012)

149 |

japi-compliance-checker-1.1.tar.gz
150 | Added many useful options, improved design of the report 151 |

152 |
  • New Features 153 |
    • Improved design of the compatibility report 154 |
    • Added compatibility rate in the summary of the report 155 |
    • Added "Other Changes in Data Types" section of the compatibility report 156 |
    157 |
158 | 167 |
  • Other 168 |
    • Code cleaning 169 |
    170 |
171 |

Version 1.0.3 (December 13, 2011)

172 |

japi-compliance-checker-1.0.3.tar.gz
173 | This is a bug fix release. 174 |

175 |
  • New Features 176 |
    • Add Makefile.pl installer (1844) 177 |
    178 |
179 |
  • Other 180 |
    • Corrected INSTALL file 181 |
    • Corrected help message 182 |
    • Changed license to dual GPL and LGPL of any version 183 |
    • Added check for presence of installed JDK-devel package in the system 184 |
    • Updated copyrights 185 |
    186 |
187 |

Version 1.0 (August 30, 2011)

188 |

japi-compliance-checker-1.0.tar.gz
189 | Initial prototype of the tool. Tested on 38 Java libraries. 190 |

191 | 198 | 199 | 200 |
-------------------------------------------------------------------------------- /doc/Readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Java API Compliance Checker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 30 | 31 | 32 |
33 |
34 | 35 | 36 |

Java API Compliance Checker

37 |
38 |
39 |
40 | 41 | 42 |

Java API Compliance Checker (Java ACC) is a tool for checking backward binary and source-level compatibility of a Java library API. The tool checks classes declarations of old and new versions and analyzes changes that may break compatibility: removed methods, removed class fields, added abstract methods, etc. The HTML compatibility report generated by this tool include separate sections for both source and binary compatibility analysis and exact error messages of the jvm and the compiler for each break found in the API. Binary incompatibility may result in crashing or incorrect behavior of existing clients built with an old version of a library when they are running with a new one. Source incompatibility may result in recompilation errors with a new library version. The tool is intended for developers of software libraries and maintainers of operating system who are interested in ensuring backward compatibility, i.e. allow old clients to run or to be recompiled with newer library versions. 43 |

See also: 44 |

45 | 48 |


49 |

50 |

Contents

51 | 82 |
83 |

Downloads

84 |

Releases

85 |

All releases can be downloaded from this page or github.com. 86 |

Latest release: 1.3.7 87 |

88 |

Git

89 |

Read-only access to the latest development version:
90 |    git clone git://github.com/lvc/japi-compliance-checker.git  
91 |

92 |

License

93 |

This program is free software. You may use, redistribute and/or modify it under the terms of either the GNU GPL or LGPL. 94 |

95 |

Supported Platforms

96 |

GNU/Linux, FreeBSD, Mac OS X, MS Windows. 97 |

98 |

System Requirements

99 |
  • Linux, FreeBSD, Mac OS X 100 |
    • JDK (javap, javac) 101 |
    • Perl 5 (5.8 or newer) 102 |
    103 |
104 |
  • MS Windows 105 | 108 |
109 |

Detectable Compatibility Problems

110 |

The tool searches for the following list of changes in the API that may break binary/source-level compatibility. See this list of articles for more info. 111 |

112 |
  • Problems with Data Types 113 |
    • Classes and Interfaces 114 |
      • removed classes or interfaces 115 |
      • removed fields 116 |
      • removed methods 117 |
      • change of a field type 118 |
      • change of a field access level 119 |
      • change of a field attributes (final, static, etc.) 120 |
      • change of a constant field value 121 |
      • changes in fields (recursive analysis) 122 |
      • added/removed abstract methods 123 |
      • added/removed super-interfaces 124 |
      125 |
    • Classes 126 |
      • added/removed super-classes 127 |
      • moving a method up class hierarchy 128 |
      • overridden methods 129 |
      130 |
    131 |
  • Problems with Methods 132 |
    • changed attributes (static, final, synchronized, abstract, etc.) 133 |
    • changed access level 134 |
    • added/removed exceptions 135 |
    136 |
  • Problems with Implementation 137 |
    • changes in decompiled binary code 138 |
    139 |
140 |


141 | You can see detailed problem descriptions in the visual interactive HTML-format compatibility report (see this example) generated by the tool. 142 |

143 |

Limitations

144 |

The tool cannot check compatibility problems related to changes in code annotations. 145 |

146 |

Installation

147 |

The tool is ready-to-use after extracting the archive. You can also use a Makefile to install the tool into the system:
148 |  cd japi-compliance-checker-x.y.z/ 

149 |  sudo perl Makefile.pl -install --prefix=PREFIX [/usr, /usr/local, ...]  150 |

This command will install a  japi-compliance-checker  program in the  PREFIX/bin  system directory. 151 |

To verify that the tool is installed correctly and it works on your host run:
152 |  cd tmp/ 

153 |  japi-compliance-checker -test 

154 |

155 |

Usage

156 |

Compare Java ARchives

157 |

Command to compare two java archives:
158 |    japi-compliance-checker V1.jar V2.jar 

159 |

The compatibility report will be generated to:
160 |    compat_reports/NAME/V1_to_V2/compat_report.html  161 |

162 |

Compare Libraries

163 |

To compare different versions of a library that consists of many JARs you should create XML descriptors for two library versions: v1.xml and v2.xml files. Library descriptor is a simple XML-file that specifies version number, paths to Java ARchives and other optional information. An example of the descriptor is the following (1.0.xml): 164 |

165 |
 <version>
166 |      1.0
167 |  </version>
168 |  
169 |  <archives>
170 |      /path1/to/JAR(s)/
171 |      /path2/to/JAR(s)/
172 |        ...
173 |  </archives>
174 | 
175 |

Command to compare two versions of a library:
176 |    japi-compliance-checker -lib NAME -old V1.xml -new V2.xml 

177 |

The compatibility report will be generated to:
178 |    compat_reports/NAME/V1_to_V2/compat_report.html  179 |

180 |

Check Clients Portability

181 |

Command to check a client portability to a newer version of a Java library API:
182 |    japi-compliance-checker -lib NAME -old V1.xml -new V2.xml -client CLIENT.jar  183 |

184 |

Dump Library API to TXT file

185 |

Command to dump a Java library API to gzipped TXT format file:
186 |    japi-compliance-checker -lib NAME -dump VER.xml 

187 | The API dump will be generated to:
188 |    api_dumps/NAME/NAME_VER.api.tar.gz 
189 |

190 |

Command-Line Options

191 |

See the list of all options on this page. 192 |

193 |

Examples

194 |

Check the JDO library API versions for compatibility:
195 |    japi-compliance-checker jdo-api-2.0.jar jdo-api-3.0.jar 

196 | The report will be generated to:
197 |    compat_reports/jdo/2.0_to_3.0/compat_report.html 

198 | Dump library API:
199 |    japi-compliance-checker -l jdo -dump jdo-api-2.0.jar 

200 | The API dump will be generated to:
201 |    api_dumps/jdo/jdo_2.0.api.tar.gz 

202 | Check client application portability between JDO versions:
203 |    japi-compliance-checker -l jdo -old jdo-api-2.0.jar -new jdo-api-3.0.jar -client Teller.jar 
204 |

205 |

Report Format

206 |

The HTML-format compatibility report consists of: 207 |

208 |
  • Test Info - The library name and compared version numbers. 209 |
  • Summary - Verdict on compatibility. Number of archives, classes and methods checked by the tool. 210 |
  • Problem Summary - Classification of compatibility problems. 211 |
  • Added Methods - The list of added methods. 212 |
  • Removed Methods - The list of removed methods. 213 |
  • Problems with Data Types - List of compatibility problems caused by changes in data types (divided by the severity level: High, Medium, Low). List of affected methods. 214 |
  • Problems with Methods - The list of compatibility problems caused by changes in method parameters and attributes (divided by the severity level). 215 |
  • Other Changes in Data Types - The list of compatible changes in data types; 216 |
  • Other Changes in Methods - The list of compatible changes in methods; 217 |
  • Problems with Implementation - The list of changes in decompiled binary code. Use -check-implementation option to enable this section. 218 |
219 |

Examples of HTML-format report: 220 |

221 |
  • JDO: 2.2 to 3.0 API compatibility report 222 |
  • SLF4J: 1.5.11 to 1.6.0 binary compatibility report 223 |
  • Struts: 2.1.6 to 2.1.8 source compatibility report 224 |
225 |

Verdict on Compatibility

226 |

If the tool detected problems with high or medium level of severity or at least one removed method then the compatibility verdict is incompatible (otherwise compatible). Low-severity problems can be considered as warnings and don't affect the compatibility verdict unless the -strict option is specified. 227 |

228 |

Error Codes

229 | 230 | 231 | 233 | 235 | 236 | 238 | 240 | 241 | 243 | 245 | 246 | 248 | 250 | 251 | 253 | 255 | 256 | 258 | 260 | 261 | 263 | 265 | 266 | 268 | 270 | 271 | 273 |
Code 232 | Meaning 234 |
0 237 | Compatible. The tool has run without any errors. 239 |
1 242 | Incompatible. The tool has run without any errors. 244 |
2 247 | Common error code (undifferentiated). 249 |
3 252 | A system command is not found. 254 |
4 257 | Cannot access input files. 259 |
7 262 | Invalid input API dump. 264 |
8 267 | Unsupported version of input API dump. 269 |
9 272 | Cannot find a module. 274 |
275 |

Similar Tools

276 |
  1. SigTest - Oracle's SigTest signature testing and API conformance tool 277 |
  2. Clirr - checks Java libraries for binary and source compatibility with older releases 278 |
  3. Japitools - test for compatibility between Java APIs 279 |
  4. Jour - Java API compatibility testing tools 280 |
  5. Japi-checker - a java API backward compatibility checker which works at binary level 281 |
282 |

Bugs

283 |

Please send your bug reports, feature requests and questions to the the maintainer, post to issue tracker or mailing list. 284 |

285 |

Maintainers

286 |

The tool was originally developed by the Russian Linux Verification Center at ISPRAS and since 1.0.3 version it's developed by the ROSA Laboratory in Russia. Andrey Ponomarenko is the leader of this project. 287 |

288 |

Articles

289 |
  1. “Evolving Java-based APIs: Achieving API Binary Compatibility”, Jim des Rivières 290 |
  2. “Binary Compatibility”, Java Language Specification 291 |
  3. “Kinds of Compatibility: Source, Binary, and Behavioral”, Joseph D. Darcy's Oracle Weblog 292 |
293 |

/code> 294 |

295 | 302 | 303 | 304 |
-------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This program is free software. You may use, redistribute and/or modify it 2 | under the terms of either the GNU General Public License (GPL) or the GNU 3 | Lesser General Public License (LGPL). 4 | 5 | --------------------------------------------------------------------------- 6 | 7 | GNU GENERAL PUBLIC LICENSE 8 | Version 2, June 1991 9 | 10 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 11 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 12 | Everyone is permitted to copy and distribute verbatim copies 13 | of this license document, but changing it is not allowed. 14 | 15 | Preamble 16 | 17 | The licenses for most software are designed to take away your 18 | freedom to share and change it. By contrast, the GNU General Public 19 | License is intended to guarantee your freedom to share and change free 20 | software--to make sure the software is free for all its users. This 21 | General Public License applies to most of the Free Software 22 | Foundation's software and to any other program whose authors commit to 23 | using it. (Some other Free Software Foundation software is covered by 24 | the GNU Lesser General Public License instead.) You can apply it to 25 | your programs, too. 26 | 27 | When we speak of free software, we are referring to freedom, not 28 | price. Our General Public Licenses are designed to make sure that you 29 | have the freedom to distribute copies of free software (and charge for 30 | this service if you wish), that you receive source code or can get it 31 | if you want it, that you can change the software or use pieces of it 32 | in new free programs; and that you know you can do these things. 33 | 34 | To protect your rights, we need to make restrictions that forbid 35 | anyone to deny you these rights or to ask you to surrender the rights. 36 | These restrictions translate to certain responsibilities for you if you 37 | distribute copies of the software, or if you modify it. 38 | 39 | For example, if you distribute copies of such a program, whether 40 | gratis or for a fee, you must give the recipients all the rights that 41 | you have. You must make sure that they, too, receive or can get the 42 | source code. And you must show them these terms so they know their 43 | rights. 44 | 45 | We protect your rights with two steps: (1) copyright the software, and 46 | (2) offer you this license which gives you legal permission to copy, 47 | distribute and/or modify the software. 48 | 49 | Also, for each author's protection and ours, we want to make certain 50 | that everyone understands that there is no warranty for this free 51 | software. If the software is modified by someone else and passed on, we 52 | want its recipients to know that what they have is not the original, so 53 | that any problems introduced by others will not reflect on the original 54 | authors' reputations. 55 | 56 | Finally, any free program is threatened constantly by software 57 | patents. We wish to avoid the danger that redistributors of a free 58 | program will individually obtain patent licenses, in effect making the 59 | program proprietary. To prevent this, we have made it clear that any 60 | patent must be licensed for everyone's free use or not licensed at all. 61 | 62 | The precise terms and conditions for copying, distribution and 63 | modification follow. 64 | 65 | GNU GENERAL PUBLIC LICENSE 66 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 67 | 68 | 0. This License applies to any program or other work which contains 69 | a notice placed by the copyright holder saying it may be distributed 70 | under the terms of this General Public License. The "Program", below, 71 | refers to any such program or work, and a "work based on the Program" 72 | means either the Program or any derivative work under copyright law: 73 | that is to say, a work containing the Program or a portion of it, 74 | either verbatim or with modifications and/or translated into another 75 | language. (Hereinafter, translation is included without limitation in 76 | the term "modification".) Each licensee is addressed as "you". 77 | 78 | Activities other than copying, distribution and modification are not 79 | covered by this License; they are outside its scope. The act of 80 | running the Program is not restricted, and the output from the Program 81 | is covered only if its contents constitute a work based on the 82 | Program (independent of having been made by running the Program). 83 | Whether that is true depends on what the Program does. 84 | 85 | 1. You may copy and distribute verbatim copies of the Program's 86 | source code as you receive it, in any medium, provided that you 87 | conspicuously and appropriately publish on each copy an appropriate 88 | copyright notice and disclaimer of warranty; keep intact all the 89 | notices that refer to this License and to the absence of any warranty; 90 | and give any other recipients of the Program a copy of this License 91 | along with the Program. 92 | 93 | You may charge a fee for the physical act of transferring a copy, and 94 | you may at your option offer warranty protection in exchange for a fee. 95 | 96 | 2. You may modify your copy or copies of the Program or any portion 97 | of it, thus forming a work based on the Program, and copy and 98 | distribute such modifications or work under the terms of Section 1 99 | above, provided that you also meet all of these conditions: 100 | 101 | a) You must cause the modified files to carry prominent notices 102 | stating that you changed the files and the date of any change. 103 | 104 | b) You must cause any work that you distribute or publish, that in 105 | whole or in part contains or is derived from the Program or any 106 | part thereof, to be licensed as a whole at no charge to all third 107 | parties under the terms of this License. 108 | 109 | c) If the modified program normally reads commands interactively 110 | when run, you must cause it, when started running for such 111 | interactive use in the most ordinary way, to print or display an 112 | announcement including an appropriate copyright notice and a 113 | notice that there is no warranty (or else, saying that you provide 114 | a warranty) and that users may redistribute the program under 115 | these conditions, and telling the user how to view a copy of this 116 | License. (Exception: if the Program itself is interactive but 117 | does not normally print such an announcement, your work based on 118 | the Program is not required to print an announcement.) 119 | 120 | These requirements apply to the modified work as a whole. If 121 | identifiable sections of that work are not derived from the Program, 122 | and can be reasonably considered independent and separate works in 123 | themselves, then this License, and its terms, do not apply to those 124 | sections when you distribute them as separate works. But when you 125 | distribute the same sections as part of a whole which is a work based 126 | on the Program, the distribution of the whole must be on the terms of 127 | this License, whose permissions for other licensees extend to the 128 | entire whole, and thus to each and every part regardless of who wrote it. 129 | 130 | Thus, it is not the intent of this section to claim rights or contest 131 | your rights to work written entirely by you; rather, the intent is to 132 | exercise the right to control the distribution of derivative or 133 | collective works based on the Program. 134 | 135 | In addition, mere aggregation of another work not based on the Program 136 | with the Program (or with a work based on the Program) on a volume of 137 | a storage or distribution medium does not bring the other work under 138 | the scope of this License. 139 | 140 | 3. You may copy and distribute the Program (or a work based on it, 141 | under Section 2) in object code or executable form under the terms of 142 | Sections 1 and 2 above provided that you also do one of the following: 143 | 144 | a) Accompany it with the complete corresponding machine-readable 145 | source code, which must be distributed under the terms of Sections 146 | 1 and 2 above on a medium customarily used for software interchange; or, 147 | 148 | b) Accompany it with a written offer, valid for at least three 149 | years, to give any third party, for a charge no more than your 150 | cost of physically performing source distribution, a complete 151 | machine-readable copy of the corresponding source code, to be 152 | distributed under the terms of Sections 1 and 2 above on a medium 153 | customarily used for software interchange; or, 154 | 155 | c) Accompany it with the information you received as to the offer 156 | to distribute corresponding source code. (This alternative is 157 | allowed only for noncommercial distribution and only if you 158 | received the program in object code or executable form with such 159 | an offer, in accord with Subsection b above.) 160 | 161 | The source code for a work means the preferred form of the work for 162 | making modifications to it. For an executable work, complete source 163 | code means all the source code for all modules it contains, plus any 164 | associated interface definition files, plus the scripts used to 165 | control compilation and installation of the executable. However, as a 166 | special exception, the source code distributed need not include 167 | anything that is normally distributed (in either source or binary 168 | form) with the major components (compiler, kernel, and so on) of the 169 | operating system on which the executable runs, unless that component 170 | itself accompanies the executable. 171 | 172 | If distribution of executable or object code is made by offering 173 | access to copy from a designated place, then offering equivalent 174 | access to copy the source code from the same place counts as 175 | distribution of the source code, even though third parties are not 176 | compelled to copy the source along with the object code. 177 | 178 | 4. You may not copy, modify, sublicense, or distribute the Program 179 | except as expressly provided under this License. Any attempt 180 | otherwise to copy, modify, sublicense or distribute the Program is 181 | void, and will automatically terminate your rights under this License. 182 | However, parties who have received copies, or rights, from you under 183 | this License will not have their licenses terminated so long as such 184 | parties remain in full compliance. 185 | 186 | 5. You are not required to accept this License, since you have not 187 | signed it. However, nothing else grants you permission to modify or 188 | distribute the Program or its derivative works. These actions are 189 | prohibited by law if you do not accept this License. Therefore, by 190 | modifying or distributing the Program (or any work based on the 191 | Program), you indicate your acceptance of this License to do so, and 192 | all its terms and conditions for copying, distributing or modifying 193 | the Program or works based on it. 194 | 195 | 6. Each time you redistribute the Program (or any work based on the 196 | Program), the recipient automatically receives a license from the 197 | original licensor to copy, distribute or modify the Program subject to 198 | these terms and conditions. You may not impose any further 199 | restrictions on the recipients' exercise of the rights granted herein. 200 | You are not responsible for enforcing compliance by third parties to 201 | this License. 202 | 203 | 7. If, as a consequence of a court judgment or allegation of patent 204 | infringement or for any other reason (not limited to patent issues), 205 | conditions are imposed on you (whether by court order, agreement or 206 | otherwise) that contradict the conditions of this License, they do not 207 | excuse you from the conditions of this License. If you cannot 208 | distribute so as to satisfy simultaneously your obligations under this 209 | License and any other pertinent obligations, then as a consequence you 210 | may not distribute the Program at all. For example, if a patent 211 | license would not permit royalty-free redistribution of the Program by 212 | all those who receive copies directly or indirectly through you, then 213 | the only way you could satisfy both it and this License would be to 214 | refrain entirely from distribution of the Program. 215 | 216 | If any portion of this section is held invalid or unenforceable under 217 | any particular circumstance, the balance of the section is intended to 218 | apply and the section as a whole is intended to apply in other 219 | circumstances. 220 | 221 | It is not the purpose of this section to induce you to infringe any 222 | patents or other property right claims or to contest validity of any 223 | such claims; this section has the sole purpose of protecting the 224 | integrity of the free software distribution system, which is 225 | implemented by public license practices. Many people have made 226 | generous contributions to the wide range of software distributed 227 | through that system in reliance on consistent application of that 228 | system; it is up to the author/donor to decide if he or she is willing 229 | to distribute software through any other system and a licensee cannot 230 | impose that choice. 231 | 232 | This section is intended to make thoroughly clear what is believed to 233 | be a consequence of the rest of this License. 234 | 235 | 8. If the distribution and/or use of the Program is restricted in 236 | certain countries either by patents or by copyrighted interfaces, the 237 | original copyright holder who places the Program under this License 238 | may add an explicit geographical distribution limitation excluding 239 | those countries, so that distribution is permitted only in or among 240 | countries not thus excluded. In such case, this License incorporates 241 | the limitation as if written in the body of this License. 242 | 243 | 9. The Free Software Foundation may publish revised and/or new versions 244 | of the General Public License from time to time. Such new versions will 245 | be similar in spirit to the present version, but may differ in detail to 246 | address new problems or concerns. 247 | 248 | Each version is given a distinguishing version number. If the Program 249 | specifies a version number of this License which applies to it and "any 250 | later version", you have the option of following the terms and conditions 251 | either of that version or of any later version published by the Free 252 | Software Foundation. If the Program does not specify a version number of 253 | this License, you may choose any version ever published by the Free Software 254 | Foundation. 255 | 256 | 10. If you wish to incorporate parts of the Program into other free 257 | programs whose distribution conditions are different, write to the author 258 | to ask for permission. For software which is copyrighted by the Free 259 | Software Foundation, write to the Free Software Foundation; we sometimes 260 | make exceptions for this. Our decision will be guided by the two goals 261 | of preserving the free status of all derivatives of our free software and 262 | of promoting the sharing and reuse of software generally. 263 | 264 | NO WARRANTY 265 | 266 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 267 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 268 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 269 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 270 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 271 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 272 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 273 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 274 | REPAIR OR CORRECTION. 275 | 276 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 277 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 278 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 279 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 280 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 281 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 282 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 283 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 284 | POSSIBILITY OF SUCH DAMAGES. 285 | 286 | END OF TERMS AND CONDITIONS 287 | 288 | How to Apply These Terms to Your New Programs 289 | 290 | If you develop a new program, and you want it to be of the greatest 291 | possible use to the public, the best way to achieve this is to make it 292 | free software which everyone can redistribute and change under these terms. 293 | 294 | To do so, attach the following notices to the program. It is safest 295 | to attach them to the start of each source file to most effectively 296 | convey the exclusion of warranty; and each file should have at least 297 | the "copyright" line and a pointer to where the full notice is found. 298 | 299 | 300 | Copyright (C) 301 | 302 | This program is free software; you can redistribute it and/or modify 303 | it under the terms of the GNU General Public License as published by 304 | the Free Software Foundation; either version 2 of the License, or 305 | (at your option) any later version. 306 | 307 | This program is distributed in the hope that it will be useful, 308 | but WITHOUT ANY WARRANTY; without even the implied warranty of 309 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 310 | GNU General Public License for more details. 311 | 312 | You should have received a copy of the GNU General Public License along 313 | with this program; if not, write to the Free Software Foundation, Inc., 314 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 315 | 316 | Also add information on how to contact you by electronic and paper mail. 317 | 318 | If the program is interactive, make it output a short notice like this 319 | when it starts in an interactive mode: 320 | 321 | Gnomovision version 69, Copyright (C) year name of author 322 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 323 | This is free software, and you are welcome to redistribute it 324 | under certain conditions; type `show c' for details. 325 | 326 | The hypothetical commands `show w' and `show c' should show the appropriate 327 | parts of the General Public License. Of course, the commands you use may 328 | be called something other than `show w' and `show c'; they could even be 329 | mouse-clicks or menu items--whatever suits your program. 330 | 331 | You should also get your employer (if you work as a programmer) or your 332 | school, if any, to sign a "copyright disclaimer" for the program, if 333 | necessary. Here is a sample; alter the names: 334 | 335 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 336 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 337 | 338 | , 1 April 1989 339 | Ty Coon, President of Vice 340 | 341 | This General Public License does not permit incorporating your program into 342 | proprietary programs. If your program is a subroutine library, you may 343 | consider it more useful to permit linking proprietary applications with the 344 | library. If this is what you want to do, use the GNU Lesser General 345 | Public License instead of this License. 346 | 347 | --------------------------------------------------------------------------- 348 | 349 | GNU LIBRARY GENERAL PUBLIC LICENSE 350 | Version 2, June 1991 351 | 352 | Copyright (C) 1991 Free Software Foundation, Inc. 353 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 354 | Everyone is permitted to copy and distribute verbatim copies 355 | of this license document, but changing it is not allowed. 356 | 357 | [This is the first released version of the library GPL. It is 358 | numbered 2 because it goes with version 2 of the ordinary GPL.] 359 | 360 | Preamble 361 | 362 | The licenses for most software are designed to take away your 363 | freedom to share and change it. By contrast, the GNU General Public 364 | Licenses are intended to guarantee your freedom to share and change 365 | free software--to make sure the software is free for all its users. 366 | 367 | This license, the Library General Public License, applies to some 368 | specially designated Free Software Foundation software, and to any 369 | other libraries whose authors decide to use it. You can use it for 370 | your libraries, too. 371 | 372 | When we speak of free software, we are referring to freedom, not 373 | price. Our General Public Licenses are designed to make sure that you 374 | have the freedom to distribute copies of free software (and charge for 375 | this service if you wish), that you receive source code or can get it 376 | if you want it, that you can change the software or use pieces of it 377 | in new free programs; and that you know you can do these things. 378 | 379 | To protect your rights, we need to make restrictions that forbid 380 | anyone to deny you these rights or to ask you to surrender the rights. 381 | These restrictions translate to certain responsibilities for you if 382 | you distribute copies of the library, or if you modify it. 383 | 384 | For example, if you distribute copies of the library, whether gratis 385 | or for a fee, you must give the recipients all the rights that we gave 386 | you. You must make sure that they, too, receive or can get the source 387 | code. If you link a program with the library, you must provide 388 | complete object files to the recipients so that they can relink them 389 | with the library, after making changes to the library and recompiling 390 | it. And you must show them these terms so they know their rights. 391 | 392 | Our method of protecting your rights has two steps: (1) copyright 393 | the library, and (2) offer you this license which gives you legal 394 | permission to copy, distribute and/or modify the library. 395 | 396 | Also, for each distributor's protection, we want to make certain 397 | that everyone understands that there is no warranty for this free 398 | library. If the library is modified by someone else and passed on, we 399 | want its recipients to know that what they have is not the original 400 | version, so that any problems introduced by others will not reflect on 401 | the original authors' reputations. 402 | 403 | Finally, any free program is threatened constantly by software 404 | patents. We wish to avoid the danger that companies distributing free 405 | software will individually obtain patent licenses, thus in effect 406 | transforming the program into proprietary software. To prevent this, 407 | we have made it clear that any patent must be licensed for everyone's 408 | free use or not licensed at all. 409 | 410 | Most GNU software, including some libraries, is covered by the ordinary 411 | GNU General Public License, which was designed for utility programs. This 412 | license, the GNU Library General Public License, applies to certain 413 | designated libraries. This license is quite different from the ordinary 414 | one; be sure to read it in full, and don't assume that anything in it is 415 | the same as in the ordinary license. 416 | 417 | The reason we have a separate public license for some libraries is that 418 | they blur the distinction we usually make between modifying or adding to a 419 | program and simply using it. Linking a program with a library, without 420 | changing the library, is in some sense simply using the library, and is 421 | analogous to running a utility program or application program. However, in 422 | a textual and legal sense, the linked executable is a combined work, a 423 | derivative of the original library, and the ordinary General Public License 424 | treats it as such. 425 | 426 | Because of this blurred distinction, using the ordinary General 427 | Public License for libraries did not effectively promote software 428 | sharing, because most developers did not use the libraries. We 429 | concluded that weaker conditions might promote sharing better. 430 | 431 | However, unrestricted linking of non-free programs would deprive the 432 | users of those programs of all benefit from the free status of the 433 | libraries themselves. This Library General Public License is intended to 434 | permit developers of non-free programs to use free libraries, while 435 | preserving your freedom as a user of such programs to change the free 436 | libraries that are incorporated in them. (We have not seen how to achieve 437 | this as regards changes in header files, but we have achieved it as regards 438 | changes in the actual functions of the Library.) The hope is that this 439 | will lead to faster development of free libraries. 440 | 441 | The precise terms and conditions for copying, distribution and 442 | modification follow. Pay close attention to the difference between a 443 | "work based on the library" and a "work that uses the library". The 444 | former contains code derived from the library, while the latter only 445 | works together with the library. 446 | 447 | Note that it is possible for a library to be covered by the ordinary 448 | General Public License rather than by this special one. 449 | 450 | GNU LIBRARY GENERAL PUBLIC LICENSE 451 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 452 | 453 | 0. This License Agreement applies to any software library which 454 | contains a notice placed by the copyright holder or other authorized 455 | party saying it may be distributed under the terms of this Library 456 | General Public License (also called "this License"). Each licensee is 457 | addressed as "you". 458 | 459 | A "library" means a collection of software functions and/or data 460 | prepared so as to be conveniently linked with application programs 461 | (which use some of those functions and data) to form executables. 462 | 463 | The "Library", below, refers to any such software library or work 464 | which has been distributed under these terms. A "work based on the 465 | Library" means either the Library or any derivative work under 466 | copyright law: that is to say, a work containing the Library or a 467 | portion of it, either verbatim or with modifications and/or translated 468 | straightforwardly into another language. (Hereinafter, translation is 469 | included without limitation in the term "modification".) 470 | 471 | "Source code" for a work means the preferred form of the work for 472 | making modifications to it. For a library, complete source code means 473 | all the source code for all modules it contains, plus any associated 474 | interface definition files, plus the scripts used to control compilation 475 | and installation of the library. 476 | 477 | Activities other than copying, distribution and modification are not 478 | covered by this License; they are outside its scope. The act of 479 | running a program using the Library is not restricted, and output from 480 | such a program is covered only if its contents constitute a work based 481 | on the Library (independent of the use of the Library in a tool for 482 | writing it). Whether that is true depends on what the Library does 483 | and what the program that uses the Library does. 484 | 485 | 1. You may copy and distribute verbatim copies of the Library's 486 | complete source code as you receive it, in any medium, provided that 487 | you conspicuously and appropriately publish on each copy an 488 | appropriate copyright notice and disclaimer of warranty; keep intact 489 | all the notices that refer to this License and to the absence of any 490 | warranty; and distribute a copy of this License along with the 491 | Library. 492 | 493 | You may charge a fee for the physical act of transferring a copy, 494 | and you may at your option offer warranty protection in exchange for a 495 | fee. 496 | 497 | 2. You may modify your copy or copies of the Library or any portion 498 | of it, thus forming a work based on the Library, and copy and 499 | distribute such modifications or work under the terms of Section 1 500 | above, provided that you also meet all of these conditions: 501 | 502 | a) The modified work must itself be a software library. 503 | 504 | b) You must cause the files modified to carry prominent notices 505 | stating that you changed the files and the date of any change. 506 | 507 | c) You must cause the whole of the work to be licensed at no 508 | charge to all third parties under the terms of this License. 509 | 510 | d) If a facility in the modified Library refers to a function or a 511 | table of data to be supplied by an application program that uses 512 | the facility, other than as an argument passed when the facility 513 | is invoked, then you must make a good faith effort to ensure that, 514 | in the event an application does not supply such function or 515 | table, the facility still operates, and performs whatever part of 516 | its purpose remains meaningful. 517 | 518 | (For example, a function in a library to compute square roots has 519 | a purpose that is entirely well-defined independent of the 520 | application. Therefore, Subsection 2d requires that any 521 | application-supplied function or table used by this function must 522 | be optional: if the application does not supply it, the square 523 | root function must still compute square roots.) 524 | 525 | These requirements apply to the modified work as a whole. If 526 | identifiable sections of that work are not derived from the Library, 527 | and can be reasonably considered independent and separate works in 528 | themselves, then this License, and its terms, do not apply to those 529 | sections when you distribute them as separate works. But when you 530 | distribute the same sections as part of a whole which is a work based 531 | on the Library, the distribution of the whole must be on the terms of 532 | this License, whose permissions for other licensees extend to the 533 | entire whole, and thus to each and every part regardless of who wrote 534 | it. 535 | 536 | Thus, it is not the intent of this section to claim rights or contest 537 | your rights to work written entirely by you; rather, the intent is to 538 | exercise the right to control the distribution of derivative or 539 | collective works based on the Library. 540 | 541 | In addition, mere aggregation of another work not based on the Library 542 | with the Library (or with a work based on the Library) on a volume of 543 | a storage or distribution medium does not bring the other work under 544 | the scope of this License. 545 | 546 | 3. You may opt to apply the terms of the ordinary GNU General Public 547 | License instead of this License to a given copy of the Library. To do 548 | this, you must alter all the notices that refer to this License, so 549 | that they refer to the ordinary GNU General Public License, version 2, 550 | instead of to this License. (If a newer version than version 2 of the 551 | ordinary GNU General Public License has appeared, then you can specify 552 | that version instead if you wish.) Do not make any other change in 553 | these notices. 554 | 555 | Once this change is made in a given copy, it is irreversible for 556 | that copy, so the ordinary GNU General Public License applies to all 557 | subsequent copies and derivative works made from that copy. 558 | 559 | This option is useful when you wish to copy part of the code of 560 | the Library into a program that is not a library. 561 | 562 | 4. You may copy and distribute the Library (or a portion or 563 | derivative of it, under Section 2) in object code or executable form 564 | under the terms of Sections 1 and 2 above provided that you accompany 565 | it with the complete corresponding machine-readable source code, which 566 | must be distributed under the terms of Sections 1 and 2 above on a 567 | medium customarily used for software interchange. 568 | 569 | If distribution of object code is made by offering access to copy 570 | from a designated place, then offering equivalent access to copy the 571 | source code from the same place satisfies the requirement to 572 | distribute the source code, even though third parties are not 573 | compelled to copy the source along with the object code. 574 | 575 | 5. A program that contains no derivative of any portion of the 576 | Library, but is designed to work with the Library by being compiled or 577 | linked with it, is called a "work that uses the Library". Such a 578 | work, in isolation, is not a derivative work of the Library, and 579 | therefore falls outside the scope of this License. 580 | 581 | However, linking a "work that uses the Library" with the Library 582 | creates an executable that is a derivative of the Library (because it 583 | contains portions of the Library), rather than a "work that uses the 584 | library". The executable is therefore covered by this License. 585 | Section 6 states terms for distribution of such executables. 586 | 587 | When a "work that uses the Library" uses material from a header file 588 | that is part of the Library, the object code for the work may be a 589 | derivative work of the Library even though the source code is not. 590 | Whether this is true is especially significant if the work can be 591 | linked without the Library, or if the work is itself a library. The 592 | threshold for this to be true is not precisely defined by law. 593 | 594 | If such an object file uses only numerical parameters, data 595 | structure layouts and accessors, and small macros and small inline 596 | functions (ten lines or less in length), then the use of the object 597 | file is unrestricted, regardless of whether it is legally a derivative 598 | work. (Executables containing this object code plus portions of the 599 | Library will still fall under Section 6.) 600 | 601 | Otherwise, if the work is a derivative of the Library, you may 602 | distribute the object code for the work under the terms of Section 6. 603 | Any executables containing that work also fall under Section 6, 604 | whether or not they are linked directly with the Library itself. 605 | 606 | 6. As an exception to the Sections above, you may also compile or 607 | link a "work that uses the Library" with the Library to produce a 608 | work containing portions of the Library, and distribute that work 609 | under terms of your choice, provided that the terms permit 610 | modification of the work for the customer's own use and reverse 611 | engineering for debugging such modifications. 612 | 613 | You must give prominent notice with each copy of the work that the 614 | Library is used in it and that the Library and its use are covered by 615 | this License. You must supply a copy of this License. If the work 616 | during execution displays copyright notices, you must include the 617 | copyright notice for the Library among them, as well as a reference 618 | directing the user to the copy of this License. Also, you must do one 619 | of these things: 620 | 621 | a) Accompany the work with the complete corresponding 622 | machine-readable source code for the Library including whatever 623 | changes were used in the work (which must be distributed under 624 | Sections 1 and 2 above); and, if the work is an executable linked 625 | with the Library, with the complete machine-readable "work that 626 | uses the Library", as object code and/or source code, so that the 627 | user can modify the Library and then relink to produce a modified 628 | executable containing the modified Library. (It is understood 629 | that the user who changes the contents of definitions files in the 630 | Library will not necessarily be able to recompile the application 631 | to use the modified definitions.) 632 | 633 | b) Accompany the work with a written offer, valid for at 634 | least three years, to give the same user the materials 635 | specified in Subsection 6a, above, for a charge no more 636 | than the cost of performing this distribution. 637 | 638 | c) If distribution of the work is made by offering access to copy 639 | from a designated place, offer equivalent access to copy the above 640 | specified materials from the same place. 641 | 642 | d) Verify that the user has already received a copy of these 643 | materials or that you have already sent this user a copy. 644 | 645 | For an executable, the required form of the "work that uses the 646 | Library" must include any data and utility programs needed for 647 | reproducing the executable from it. However, as a special exception, 648 | the source code distributed need not include anything that is normally 649 | distributed (in either source or binary form) with the major 650 | components (compiler, kernel, and so on) of the operating system on 651 | which the executable runs, unless that component itself accompanies 652 | the executable. 653 | 654 | It may happen that this requirement contradicts the license 655 | restrictions of other proprietary libraries that do not normally 656 | accompany the operating system. Such a contradiction means you cannot 657 | use both them and the Library together in an executable that you 658 | distribute. 659 | 660 | 7. You may place library facilities that are a work based on the 661 | Library side-by-side in a single library together with other library 662 | facilities not covered by this License, and distribute such a combined 663 | library, provided that the separate distribution of the work based on 664 | the Library and of the other library facilities is otherwise 665 | permitted, and provided that you do these two things: 666 | 667 | a) Accompany the combined library with a copy of the same work 668 | based on the Library, uncombined with any other library 669 | facilities. This must be distributed under the terms of the 670 | Sections above. 671 | 672 | b) Give prominent notice with the combined library of the fact 673 | that part of it is a work based on the Library, and explaining 674 | where to find the accompanying uncombined form of the same work. 675 | 676 | 8. You may not copy, modify, sublicense, link with, or distribute 677 | the Library except as expressly provided under this License. Any 678 | attempt otherwise to copy, modify, sublicense, link with, or 679 | distribute the Library is void, and will automatically terminate your 680 | rights under this License. However, parties who have received copies, 681 | or rights, from you under this License will not have their licenses 682 | terminated so long as such parties remain in full compliance. 683 | 684 | 9. You are not required to accept this License, since you have not 685 | signed it. However, nothing else grants you permission to modify or 686 | distribute the Library or its derivative works. These actions are 687 | prohibited by law if you do not accept this License. Therefore, by 688 | modifying or distributing the Library (or any work based on the 689 | Library), you indicate your acceptance of this License to do so, and 690 | all its terms and conditions for copying, distributing or modifying 691 | the Library or works based on it. 692 | 693 | 10. Each time you redistribute the Library (or any work based on the 694 | Library), the recipient automatically receives a license from the 695 | original licensor to copy, distribute, link with or modify the Library 696 | subject to these terms and conditions. You may not impose any further 697 | restrictions on the recipients' exercise of the rights granted herein. 698 | You are not responsible for enforcing compliance by third parties to 699 | this License. 700 | 701 | 11. If, as a consequence of a court judgment or allegation of patent 702 | infringement or for any other reason (not limited to patent issues), 703 | conditions are imposed on you (whether by court order, agreement or 704 | otherwise) that contradict the conditions of this License, they do not 705 | excuse you from the conditions of this License. If you cannot 706 | distribute so as to satisfy simultaneously your obligations under this 707 | License and any other pertinent obligations, then as a consequence you 708 | may not distribute the Library at all. For example, if a patent 709 | license would not permit royalty-free redistribution of the Library by 710 | all those who receive copies directly or indirectly through you, then 711 | the only way you could satisfy both it and this License would be to 712 | refrain entirely from distribution of the Library. 713 | 714 | If any portion of this section is held invalid or unenforceable under any 715 | particular circumstance, the balance of the section is intended to apply, 716 | and the section as a whole is intended to apply in other circumstances. 717 | 718 | It is not the purpose of this section to induce you to infringe any 719 | patents or other property right claims or to contest validity of any 720 | such claims; this section has the sole purpose of protecting the 721 | integrity of the free software distribution system which is 722 | implemented by public license practices. Many people have made 723 | generous contributions to the wide range of software distributed 724 | through that system in reliance on consistent application of that 725 | system; it is up to the author/donor to decide if he or she is willing 726 | to distribute software through any other system and a licensee cannot 727 | impose that choice. 728 | 729 | This section is intended to make thoroughly clear what is believed to 730 | be a consequence of the rest of this License. 731 | 732 | 12. If the distribution and/or use of the Library is restricted in 733 | certain countries either by patents or by copyrighted interfaces, the 734 | original copyright holder who places the Library under this License may add 735 | an explicit geographical distribution limitation excluding those countries, 736 | so that distribution is permitted only in or among countries not thus 737 | excluded. In such case, this License incorporates the limitation as if 738 | written in the body of this License. 739 | 740 | 13. The Free Software Foundation may publish revised and/or new 741 | versions of the Library General Public License from time to time. 742 | Such new versions will be similar in spirit to the present version, 743 | but may differ in detail to address new problems or concerns. 744 | 745 | Each version is given a distinguishing version number. If the Library 746 | specifies a version number of this License which applies to it and 747 | "any later version", you have the option of following the terms and 748 | conditions either of that version or of any later version published by 749 | the Free Software Foundation. If the Library does not specify a 750 | license version number, you may choose any version ever published by 751 | the Free Software Foundation. 752 | 753 | 14. If you wish to incorporate parts of the Library into other free 754 | programs whose distribution conditions are incompatible with these, 755 | write to the author to ask for permission. For software which is 756 | copyrighted by the Free Software Foundation, write to the Free 757 | Software Foundation; we sometimes make exceptions for this. Our 758 | decision will be guided by the two goals of preserving the free status 759 | of all derivatives of our free software and of promoting the sharing 760 | and reuse of software generally. 761 | 762 | NO WARRANTY 763 | 764 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 765 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 766 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 767 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 768 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 769 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 770 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 771 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 772 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 773 | 774 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 775 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 776 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 777 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 778 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 779 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 780 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 781 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 782 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 783 | DAMAGES. 784 | 785 | END OF TERMS AND CONDITIONS 786 | 787 | How to Apply These Terms to Your New Libraries 788 | 789 | If you develop a new library, and you want it to be of the greatest 790 | possible use to the public, we recommend making it free software that 791 | everyone can redistribute and change. You can do so by permitting 792 | redistribution under these terms (or, alternatively, under the terms of the 793 | ordinary General Public License). 794 | 795 | To apply these terms, attach the following notices to the library. It is 796 | safest to attach them to the start of each source file to most effectively 797 | convey the exclusion of warranty; and each file should have at least the 798 | "copyright" line and a pointer to where the full notice is found. 799 | 800 | 801 | Copyright (C) 802 | 803 | This library is free software; you can redistribute it and/or 804 | modify it under the terms of the GNU Library General Public 805 | License as published by the Free Software Foundation; either 806 | version 2 of the License, or (at your option) any later version. 807 | 808 | This library is distributed in the hope that it will be useful, 809 | but WITHOUT ANY WARRANTY; without even the implied warranty of 810 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 811 | Library General Public License for more details. 812 | 813 | You should have received a copy of the GNU Library General Public 814 | License along with this library; if not, write to the Free 815 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 816 | 817 | Also add information on how to contact you by electronic and paper mail. 818 | 819 | You should also get your employer (if you work as a programmer) or your 820 | school, if any, to sign a "copyright disclaimer" for the library, if 821 | necessary. Here is a sample; alter the names: 822 | 823 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 824 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 825 | 826 | , 1 April 1990 827 | Ty Coon, President of Vice 828 | 829 | That's all there is to it! 830 | --------------------------------------------------------------------------------