3 ms·
If you change a parameter, then you are changing the interface, and it makes sense that that affects recompilation. Changing the type is an interesting one. If
by lincolnq 17y ago
If you change a parameter, then you are changing the interface, and it makes sense that that affects recompilation.
Changing the type is an interesting one. If you change the backing class from one type to another, but you were using an interface to access it, then the Java compiler doesn't need to recompile that code -- the compiled InvokeInterface bytecode for that method invocation doesn't change. However -- I feel like I may have read this somewhere -- there are optimizations which might cause it to replace InvokeInterface with static invocations when it can determine at compile time what class is used. If that's the case, then it would have to recompile the client class too.
- eru 17y agoI was thinking about changing the type of a parameter and return type in parallel --- where the application only treats them as block boxes and just gives and takes those objects, but never looks at them.