Joshua,
Actually that's exactly what happens. The unboxed variable will first look up the conversion tree and, barring any successful match, then look for its boxed equivalent. Yes, this does affect the runtime environment (the program would function differently under JRE 1.4 than JRE 1.5), but that's the case with any version upgrade.
You can read more about boxing conversions (and the types of conversions they apply to, e.g., assignment, method invocation, etc.) in the
JLS.
Here are some examples of how it works, too (note you must be using JDK/JRE 1.5 to compile/run this code):
The output of this code is:
0
1
2
3
4
5
6
7
8
9
10
11
printInt(Byte): 12
printInt(Short): 13
printInt(Integer): 14
Notice how if you uncomment the printInt(int) function, all three unboxed variables (r, s, and t) will go back to being promoted to int, just like you'd expect.
EDIT: Fixing a few typos.
[ August 25, 2005: Message edited by: Ryan Kade ]