C binary compatibility checker
The following sections and tables describe the rules and show whether they break only source compatibility or both source and binary compatibility. Comments and clarifications follow the table for rules that have an asterisk after their number. A class is called subclassable if it has subclasses outside its package. In other words, this class is not final and has public constructor. The rules from this group are triggered if the more specific rules from the other groups below are not triggered.
For example, adding an interface method defined in rule 2. In such cases more general rule 1. API public or protected type class, interface, enum, annotation type or member method, field added. API public or protected type class, interface, enum, annotation type or c binary compatibility checker method, field removed.
C binary compatibility checker type or member visibility - from public to non-public, c binary compatibility checker protected to package or private.
Expand the set of superinterfaces direct or indirect if the added interface has a field constant. Adding a class can theoretically break source code compatibility because new classes can be incorrectly resolved in an existing client's code with type-import-on-demand declarations also know as wildcard imports.
This can happen if the code uses another type with the same simple name. This rule is considered a warning because it will probably not affect binary compatibility and adhering to this rule makes API evolution very difficult.
Generics are a facility of generic programming that was added to the Java programming language as part of Java SE version 5. Generics allow a type or method to operate on objects of various types while providing compile-time type safety. Generification upgrades types using support to-be-specified-later types that are instantiated as needed for specific types that are provided as type parameters. The Java programming language implements generics using erasure, which ensures that legacy and generic versions usually generate identical class files, except for some auxiliary information about types.
Binary compatibility is not broken because it is possible to replace a legacy c binary compatibility checker file with a generic class file without changing or recompiling any client code. To facilitate interfacing with non-generic legacy c binary compatibility checker, it is also possible to use the erasure of a parameterized type as a type.
Allowing the raw type also ensures backward compatibility for source code. According to this, the following versions of the java. Iterator class are both binary and source code backward compatible:. Adding a superinterface with a constant field can shadow another entity with the same simple name. Consider the following code:. Suppose that a c binary compatibility checker version of the Shakespeare interface implements interface Playwright as well as Poet as shown here:.
The example below shows how adding a member without a default value to an annotation type breaks source code compatibility. Changing a method from protected to c binary compatibility checker can break source code compatibility if this method was overridden as protected.
This rule is only a warning because it does not affect binary compatibility, and the probability of its affecting source code compatibility is very low. Changing or removing constant values can break source code compatibility. For example, consider the following client code example.
The client code will not compile because of the duplicate case label. Adding a regular method to a subclassable class can break source code and binary compatibility because a subclass can have a method with the same signature but with weaker access privileges.
For example consider the following code example:. The code cannot be recompiled due of an error that generates the following error message:. Adding a static method to a subclassable class can break source code and binary c binary compatibility checker, because a subclass can have a method with the same signature.
The code can not be recompiled due to an error that generates the following error message:. As in the case of rule 2. Some rules in this group apply only for class methods. Some rules from this group apply only for class fields. In this case, after adding class com. Policythe compiler raises the error reference to Policy is ambiguous, both class com. Iterator class are both binary and source code backward compatible: Iterator as it is defined in Java SE version 1. Iterator as it is defined in C binary compatibility checker SE version 5.
Consider the following code: For example consider the following code example: The code cannot be recompiled due of an error that generates the following error message: The code can not be recompiled due to an error that generates the following error message: Contract superinterface c binary compatibility checker direct or inherited.
Add member without default value to annotation type. Add member with default value to annotation type. Remove default value from member of annotation type. Change last parameter from array type T to variable array T Change last parameter from array T Decrease access from public to protected. Increase access from protected to public c binary compatibility checker the class is subclassable.
Change method from abstract to non-abstract. Change method from non-abstract c binary compatibility checker abstract if the class can be subclassed. Change method from final to non-final.
Change method from non-final to final. Change method from static to non-static. Change method from non-static to static. Change method from native to non-native. Change method from non-native to native. Change method from synchronized to non-synchronized. Change method from non-synchronized to synchronized. Add non-abstract and non-static methods. Add abstract methods if the class can be subclassed. Add static methods if the class can be subclassed. Add first constructor with arguments or throws clause.
Expand implemented interface set direct or indirect. The added interface adds abstract methods. The new interface adds fields or inner classes. Contract implemented interface set direct or indirect. Expand superclass set direct or c binary compatibility checker. Add superclass adds abstract method see c binary compatibility checker 5. Add superclass adds field see rule 5.
Contract superclass set direct or indirect. Change non-abstract to abstract if the class can be subclassed.
Binary-code compatibility binary compatible or object-code -compatible is a property of computer systems meaning that they can run the same executable codetypically machine code for a general-purpose computer CPU. Source-code compatibilityon the other hand, means that recompilation or interpretation is necessary.
For a compiled program on a general operating system, binary compatibility often implies that not only the CPUs instruction sets of the two computers are binary compatible, but also that interfaces and behaviours of the operating system and APIsand the ABIs corresponding to those APIs, are sufficiently equal, i. A term like backward-compatible usually implies object-code compatibility. Older executable code will thus run unchanged on the newer product. For a compiled program running directly on a CPU under an OS, a "binary compatible operating system" primarily means application binary interface ABI compatibility with another system.
However, it also often implies that APIs that the application depends on, directly or indirectly such as the Windows APIfor exampleare sufficiently similar.
Hardware besides the CPU, such as for graphics and peripherals that an application accesses may also be a factor for full compatibility, although many hardware differences are hidden by modern APIs often partly supplied by the OS itself and partly by specific device drivers.
In other cases, a general porting of the software must be used to make non-binary-compatible programs work. Binary compatibility is a major benefit when developing computer programs that are to be run on multiple OSes. Most OSes provide binary compatibility, in each version of the OS, for most binaries built to run on earlier versions of the OS.
For example, many executables compiled for Windows 3. For a digital processor implemented in hardware, binary compatibility means that a large subset of machine code produced for another processor can be correctly executed and has much the same effect as on the other processor.
This is quite common among many processor families, although it is rather uncommon among the ubiquitous small embedded systems built around such processors. For a more complex embedded system using more abstraction layers sometimes on the border to a general computer, such as a mobile phonethis may be different. Binary compatible operating systems are OSes that aim to implement binary compatibility with another OS, or another variant of the same brand. This means that they are ABI-compatible for application binary interface.
As the job of an OS is to run programs, the instruction set architectures running the OSes have to be the same or compatible. Otherwise, programs can be employed within a CPU emulator or a faster dynamic translation mechanism to make them compatible. For example, the Linux kernel is not compatible with Windows.
This does not mean that Linux can't be binary compatible with Windows applications. Additional software, Wineis available that does that to some degree. The ReactOS OS development effort, seeks to create an open sourcefree software OS that is binary compatible with Microsoft's Windows NT family of OSes using Wine for application compatibility and reimplementing the Windows kernel for additional compatibility such as for drivers whereas Linux would use Linux drivers not Windows drivers.
Note that a binary compatible OS is different from running an alternative OS through virtualization or emulationwhich is done to run software within the alternative OS in the case when the host OS isn't compatible. Sometimes virtualization is provided with the host OS or such software can be obtainedwhich effectively makes the host OS compatible with programs. Instead, the Classic environment was actually running Mac OS 9. From Wikipedia, the free encyclopedia. This article needs additional citations for verification.
Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. November Learn how and when to remove this template message. Archived from the original on August 2, Mac OS X Internals: Application binary interface ABI. Binary code compatibility Foreign function interface Language binding Linker dynamic Loader Year problem. Retrieved from " https: Backward compatibility Computing terminology. Articles needing additional references from November All articles needing additional references All articles with unsourced statements Articles with unsourced statements from May Views Read Edit View history.