what happens in a java jvm executing legacy code, which was invalidated by a language change
<p>Suppose you have legacy java code which can not be compiled by an up-to-date version of java. e.g.</p>

<pre><code>public class ProviderUnavailableException extends Exception {

    private int cause;

    public int getCause(){
     return cause;
    }
    // rest of implementation
}
</code></pre>

<p>Back at the time of Java 1.3 this code was valid. </p>

<p>In Java 1.4 the class Throwable 'redefined' the method getCause(). It looks like this:</p>

<pre><code>public Throwable getCause()
</code></pre>

<p>Now the legacy code is invalid (because 'int' is not a subtype of 'Throwable') but does not lead to runtime problems. Or can this happen under some circumstances?</p>

<p>Is it correct that back a the compile time, the compiler had generated the byte code to handle the execution of the method getCause solely in that class and therefore 'knows' that no super class has to be invoked?</p>

<p>EDIT</p>

<p>i checked the byte code of the legacy code with "javap -c". </p>

<pre><code>  public int getCause();
    Code: 
     0: aload_0
     1: getfield #2; //Field _cause:I
     4: ireturn
</code></pre>

<p>So it's returning the local field. Seems ok for me. </p>
