Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't use static import for MessageFormat.format
  • Loading branch information
stefanbirkner authored and ebruchez committed Mar 30, 2012
1 parent 08c7053 commit 4597173
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/junit/runners/Parameterized.java
@@ -1,7 +1,5 @@
package org.junit.runners;

import static java.text.MessageFormat.format;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down Expand Up @@ -213,13 +211,14 @@ private void createRunnersForParameters(Iterable<Object[]> allParameters,
private String nameFor(String namePattern, int index, Object[] parameters) {
String finalPattern= namePattern.replaceAll("\\{index\\}",
Integer.toString(index));
return format(finalPattern, parameters);
return MessageFormat.format(finalPattern, parameters);
}

private Exception parametersMethodReturnedWrongType() throws Exception {
String className= getTestClass().getName();
String methodName= getParametersMethod().getName();
String message= format("{0}.{1}() must return an Iterable of arrays.",
String message= MessageFormat.format(
"{0}.{1}() must return an Iterable of arrays.",
className, methodName);
return new Exception(message);
}
Expand Down

0 comments on commit 4597173

Please sign in to comment.