tag:blogger.com,1999:blog-5189454998441095165.post2338562017010252900..comments2023-05-04T06:21:53.479-07:00Comments on Moshe shamy java blog: The internal implementation of the allocate referenceMoshe Shamy java bloghttp://www.blogger.com/profile/16175725154509768374noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5189454998441095165.post-74751880468083110492009-10-26T11:38:28.897-07:002009-10-26T11:38:28.897-07:00By the way, if you're going for this approach,...By the way, if you're going for this approach, notice that you can probably implement the whole thing using your AllocatedReference (I prefer NotNullReference myself..) and something like AspectJ. Create this class, make its constructor throw an exception when it receives a null value, and using AspectJ create a keyword or prefix (maybe even an annotation) that would use the new reference type automatically, and use its constructor or "get" method automatically when being used or being cast to another value.<br /><br />Just a thought..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5189454998441095165.post-67587277524133042292009-10-26T11:25:29.564-07:002009-10-26T11:25:29.564-07:00References are just wrapper objects. They shouldn&...References are just wrapper objects. They shouldn't have a performance penalty greater than your average container, and if they're implemented well in the JVM they can have JIT accelerations.Anonymousnoreply@blogger.com