JSR-666 – The ‘that’ keyword
For those Java-readers, I’ve been a bit off colour recently so Java posts have got lost. Here’s a weird post I received in email, I’m not sure who to attribute it to – but I’ve never seen it online, so I’m posting it here for posterity…
(PS Alan Green deserves credit for deciding it should be JSR-666)
(PPS I slightly edited it to clean up the language / typos)
The “this” keyword is very useful to identify members which belong to an object or class. Coming soon in Java 1.6 is the “that” keyword, which allows you to reference members in object that
- may not even exist yet (the forward temporal offset)
- did exist but were garbage collected (the reverse temporal offset)
- exist in the same application but in a different JVM on another server
(x-tier referencing)
- exist in the same JVM but in a different dimension (5th dimension array indexing)
A requirement of “that” is that a “this” reference must exist. How else could the extra time or dimensional versions exist without a symbiotic equivalent?
Some examples might help:
public class DateFinder() {
private Date date = new Date();
public Date getCurrentDate() {
return this.date;
}
public Date getAlternateDate() {
return that.date;
}
}
Determining what “that” actualy relates to (forward temporal offset, reverse
temporal offset, x-tier referencing or 5th dimension array indexing) is achieved through static methods in the new Java Temporal Security Manager.
TemporalSecurityManager.setAlternateDimention(int dimension);
Valid dimension range is 5 onwards.
- Dimentions past 10 have not been fully expored and documented and are
currently not officialy supported by Sun.
- Dimentions lower that 5 may interfer with the 3d time space continuum and may cause objects to be constructed in the real world. This can be dangerous,
especialy for large objects or those that add more objects to themselves, like Collections. Java applications are limited by available system memory, while objects in the real world are only limited by the size of the universe itself.
- Also note that garbage collection in this case will fail when the gravitation pull of the mass of all objects exceeds the garbage collector’s thread momentum (similar to the momentum needed to launch a space ship out of the earth’s atmosphere).
For those who are curious, objects allocated in the real world are cubes
with rounded corners and range in colour from royal blue to a kind of pale
purple.
TemporalSecurityManager.setAlternateTime(GregorianCalander calendar);
The standard Gregorian calendar has 2 eras, BC and AD. Valid date ranges are can not be determined at compile time due to fluxations in the universes temporal flux field and background warp noise. It is best to simply catch TimeSpaceBreachExceptions and retry with dates closer to the current time.