Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Tuesday, June 9, 2009

How to Write an Equality Method in Java

Essential article on how to avoid common pitfalls and preserve the contract of equals() when writing an equality method in Java.
Class java.lang.Object defines an equals method, which subclasses may override. Unfortunately, it turns out that writing a correct equality method is surprisingly difficult in object-oriented languages. In fact, after studying a large body of Java code, the authors of a 2007 paper concluded that almost all implementations of equals methods are faulty.

Wednesday, January 21, 2009

SendKeys under Vista

If you are maintaining a VB6 application or something similar under Vista, and the application makes use of the SendKeys call, you will likely get an exception, particularly if you are running the application within an IDE. This appears to be due to the security model in Vista.

In my case, I was able to rewrite the code to avoid the use of SendKeys. For other possible workarounds, see: