Documentation

Articles

Are Checked Exceptions Always Caused by I/O?

Recently, I’ve had the pleasure of working with Eclipse and trying to build a plugin.  On the whole, I have to confess, I find that Eclipse is an extremely well-designed and considered piece of software.  The biggest problem, I suppose, is that it is designed for a wide variety of tasks and this means . . . → Read More: Are Checked Exceptions Always Caused by I/O?

Type Aliasing in Java?

A problem I often encounter in Java is that I want to say “these two things are the same”, but Java won’t let me. Suppose I want to maintain an int[] array which is always sorted in my program. So, whenever I get one of these things, I can rely on it being sorted. Here’s . . . → Read More: Type Aliasing in Java?

Final should be Default for Classes in Java

We were having an interesting discussion the other day, and the issue of final classes came up.  For some reason, it suddenly occurred to me that all classes should be final by default. That is, classes should be implicitly final, rather than requiring an explicit declaration.  For example, the following should be considered invalid . . . → Read More: Final should be Default for Classes in Java

Design by Contract is Most Requested Feature?

Thanks to Alex Potanin for pointing this out to me … it seems that Design by Contract is the most requested enhancement to the Java language.  You can find the list of the top 25 RFEs here.  A nice quote from the feature description:

I find it a shame that all the requests for . . . → Read More: Design by Contract is Most Requested Feature?

One Thing I Really Hate About the JVM

Whilst I think the Java Virtual Machine is generally speaking a fantastic piece of kit, there is one thing that I really hate about it: I can’t stop threads!!!

Sure, there’s a method called Thread.stop() … but it’s deprecated. There’s even a whole article devoted to why it should be deprecated.

Great.  That’s just . . . → Read More: One Thing I Really Hate About the JVM

Better Namespaces

An interesting problem I’ve encountered many times in Java is that of conflicting names.  For example,  suppose I have the following code:

import wyil.lang.*; import wyil.lang.Type.*; … public static Type T_Bool = new Type.Bool();

This is all well and good.  The problem arises when I want to import another class called Type from some . . . → Read More: Better Namespaces

Java Pathfinder

Recently, Simon Doherty gave a short talk on using Java Pathfinder to find bugs in Java programs. Java Pathfinder is a model checker for Java code, particularly suited to reasoning about multi-threaded code and finding concurrency bugs. Roughly speaking, it searches through all of the different possible execution traces for a given piece of . . . → Read More: Java Pathfinder