Enhancing The Java Programming Language
Improving JavaBean Coding
The first thing I have is to improve the coding of any type of JavaBean. Most of us understand any type of java bean has members and great deal of getters as well as setters. But also for lot of participant variables it becomes tedious to create the getters and the setters. The Java api can easily make it part of the jdk so that the getters and the setters are generated instantly. There can be a pen interface which any JavaBean class can apply and that will tell the compiler to produce the getter and also setter code during collection procedure. Of course, if you have any kind of customized getter or setter, that will certainly override the system created ones.
Maximizing Garbage Collection
My 2nd concept is on garbage collection. Now the JVM runs the trash string and also instantly tidies up memory for objects whose referral matter is absolutely no. But a few of these checks can be accomplished throughout compile time. If some object is developed within a technique and it is assigned to regional variable just during collection, the compiler can immediately create trash code when the approach exits. This will not take place if the things is returned or connected to some non-local variable. This will certainly make the work of the garbage collector string much easier and also will result in a much faster program.
One can also think of returning the delete functionality optionally. This will certainly lead to less help the compiler and
definitely for the JVM. If the devloper is unsure if to use
the delete capability, he may leave it to the compiler or the
JVM. For instance, the developer did an error of calling remove
on the very same referral two times. This will cause MemoryAlreadyDeletedException (something like that) or plain old
NullPointerException. Unlike in C++ globe, programmer can just
take the erase out completely, as well as the issue will vanish.