In this paper we present a new model of Java programs. We show how a program can be compiled into the model. The model can be directly used by a model-based diagnosis engine in order to determine the set of possible causes for a detected misbehavior. The new model is based on the concept of dependencies between variables of a program but leads to improvements with respect to the quality of diagnosis results. First experimental results show the improvements of the presented approach.