Check out the new USENIX Web site. next up previous
Next: Virtual Methods Up: Supporting Binary Compatibility with Previous: Scenario C: Binary Change


Our Approach

SEC

In this section we present our solution for static compilers to support Java binary compatibility. Table 1 and Table 2 summarize all the binary changes to classes and interfaces specified in Chapter 13 of the Java language specification [12]. Compatible changes are marked with ``$ +$'' and incompatible changes are marked with ``$ -$''. We present the solutions for these changes in the coming subsections. In these tables, SEC x means the solution is presented in Section x. The symbol ``$trivial$'' is only used for binary compatible changes. It means that the solution is trivial and requires no change to the existing implementation. The numbers associated with each binary change are used for cross-referencing in later sections.


Table 1: Java binary compatibility summary: classes.
No. $ +$/$ -$ Binary Change to Class Solution
1 $ +$ adding(overriding) method/constructor (without modifier change)  SEC 4.1
2 $ +$ changing hierarchy preserving super(s)  SEC 4.1
3 $ +$ adding field (without modifier change)  SEC 4.2
4 $ +$ abstract -> nonabstract  
5 $ +$ final -> nonfinal  
6 $ +$ nonpublic -> public  
7 $ +$ allowing more access to member  
8 $ +$ final field -> nonfinal field  
9 $ +$ adding/deleting transient modifier  
10 $ +$ changing formal parameter name of method/constructor  
11 $ +$ abstract method -> nonabstract  
12 $ +$ final method -> nonfinal; nonfinal static meth -> final static  
13 $ +$ changing synchronized modifier  
14 $ +$ changing throws clause  
15 $ +$ changing method/constructor body  
16 $ +$ adding method/constructor that overloads existing one  
17 $ +$ changing static initializer  
18 $ -$ removing method/constructor  SEC 4.1
19 $ -$ removing field  SEC 4.2
20 $ -$ changing hierarchy without preserving super(s)  SEC 4.4.1
21 $ -$ noncircular hierarchy -> circular hierarchy  SEC 4.4.1
22 $ -$ nonfinal -> final  SEC 4.4.1
23 $ -$ nonabstract -> abstract  SEC 4.4.1
24 $ -$ nonfinal virtual method -> final virtual  SEC 4.4.2
25 $ -$ restricting access to member  SEC 4.4.2
26 $ -$ nonfinal field -> final field  SEC 4.4.2
27 $ -$ static <-> instance member  SEC 4.4.2
28 $ -$ nonabstract method -> abstract  SEC 4.4.2
29 $ -$ public -> nonpublic  SEC 4.4.2
30 $ +$/$ -$ adding(overriding) method (with modifier change)  4.4.3
31 $ +$/$ -$ adding field (with modifier change)  4.4.3
32 $ +$/$ -$ changing signature  4.4.3
33 $ +$/$ -$ about native methods  4.4.3



Table 2: Java binary compatibility summary: interfaces.
No. $ +$/$ -$ Binary Change to Interface Solution
34 $ +$ changing hierarchy preserving super(s)  SEC 4.3
35 $ +$ nonpublic -> public  
36 $ +$ adding/deleting transient modifier  
37 $ +$ changing formal parameter name of method  
38 $ +$ changing synchronized modifier  
39 $ +$ adding method that overloads existing one  
40 $ -$ removing member  SEC 4.3
41 $ -$ changing hierarchy without preserving super(s)  SEC 4.4.1
42 $ -$ public -> nonpublic  SEC 4.4.2
43 $ +$/$ -$ adding field  SEC 4.2
 SEC 4.4.3
44 $ +$/$ -$ adding method  SEC 4.3
 SEC 4.4.3
45 $ +$/$ -$ changing signature  SEC 4.4.3




Subsections
next up previous
Next: Virtual Methods Up: Supporting Binary Compatibility with Previous: Scenario C: Binary Change
Dachuan Yu 2002-05-23