Refactoring error messages. I changed 'em from public static final constants to methods. The benefit is that now the arguments are typechecked. More importantly, now we can gather coverage on methods. Which opens the door to figuring out which methods we have test coverage for (not very many!)

git-svn-id: https://google-guice.googlecode.com/svn/trunk@516 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/src/com/google/inject/commands/BindCommand.java b/src/com/google/inject/commands/BindCommand.java
index e012873..9adb025 100644
--- a/src/com/google/inject/commands/BindCommand.java
+++ b/src/com/google/inject/commands/BindCommand.java
@@ -16,15 +16,18 @@
 
 package com.google.inject.commands;
 
-import com.google.inject.*;
+import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.inject.Binder;
+import com.google.inject.Key;
+import com.google.inject.Provider;
+import com.google.inject.Scope;
+import com.google.inject.TypeLiteral;
 import com.google.inject.binder.AnnotatedBindingBuilder;
 import com.google.inject.binder.ConstantBindingBuilder;
 import com.google.inject.binder.LinkedBindingBuilder;
 import com.google.inject.binder.ScopedBindingBuilder;
-import com.google.inject.internal.ErrorMessages;
+import com.google.inject.internal.ErrorMessage;
 import com.google.inject.spi.SourceProviders;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import java.lang.annotation.Annotation;
 
 /**
@@ -183,7 +186,7 @@
     }
 
     public void toInstance(final T instance) {
-      checkNotNull(instance, ErrorMessages.CANNOT_BIND_TO_NULL_INSTANCE);
+      checkNotNull(instance, ErrorMessage.cannotBindToNullInstance().toString());
 
       checkNotTargetted();
       bindTarget = new AbstractTarget<T>() {