Skip to content

Commit

Permalink
HV-481 Removing use of org.hibernate.validator.internal.util.logging.…
Browse files Browse the repository at this point in the history
…Log in public classes
  • Loading branch information
hferentschik committed Mar 2, 2012
1 parent 5f0fe31 commit 9373be7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
Expand Up @@ -22,7 +22,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.IllegalFormatException;
import java.util.List;
import java.util.Set;
import java.util.regex.PatternSyntaxException;
Expand Down Expand Up @@ -207,15 +206,6 @@ public interface Log extends BasicLogger {
@Message(id = 48, value = "Unable to expand group sequence.")
GroupDefinitionException throwUnableToExpandGroupSequence();

@Message(id = 49, value = "The given index must be between %1$s and %2$s.")
IndexOutOfBoundsException throwInvalidIndex(String lowerBound, String upperBound);

@Message(id = 50, value = "Missing format string in template: %s.")
ValidationException throwMissingFormatStringInTemplate(String expression);

@Message(id = 51, value = "Invalid format: %s.")
ValidationException throwInvalidFormat(String message, @Cause IllegalFormatException e);

@Message(id = 52,
value = "Default group sequence and default group sequence provider cannot be defined at the same time.")
GroupDefinitionException throwInvalidDefaultGroupSequenceDefinition();
Expand Down
Expand Up @@ -22,9 +22,13 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.validation.MessageInterpolator;
import javax.validation.ValidationException;

import org.hibernate.validator.internal.util.logging.Log;
import org.hibernate.validator.internal.util.logging.LoggerFactory;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Cause;
import org.jboss.logging.Logger;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;


/**
Expand All @@ -38,8 +42,10 @@
* @author Hardy Ferentschik
*/
public class ValueFormatterMessageInterpolator implements MessageInterpolator {

private static final Log log = LoggerFactory.make();
private static final Log log = Logger.getMessageLogger(
Log.class,
ValueFormatterMessageInterpolator.class.getName()
);

public static final String VALIDATED_VALUE_KEYWORD = "validatedValue";
public static final String VALIDATED_VALUE_FORMAT_SEPARATOR = ":";
Expand Down Expand Up @@ -174,4 +180,17 @@ private String interpolateValidatedValue(String expression, Object validatedValu
}
return interpolatedValue;
}

@MessageLogger(projectCode = "HV")
public interface Log extends BasicLogger {
@Message(id = 50, value = "Missing format string in template: %s.")
ValidationException throwMissingFormatStringInTemplate(String expression);

@Message(id = 51, value = "Invalid format: %s.")
ValidationException throwInvalidFormat(String message, @Cause IllegalFormatException e);

@Message(id = 49, value = "The given index must be between %1$s and %2$s.")
IndexOutOfBoundsException throwInvalidIndex(String lowerBound, String upperBound);
}

}
Expand Up @@ -22,8 +22,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.hibernate.validator.internal.util.logging.Log;
import org.hibernate.validator.internal.util.logging.LoggerFactory;
import org.jboss.logging.Logger;

/**
* A resource bundle locator, that loads resource bundles by simply
Expand All @@ -33,8 +32,7 @@
* @author Gunnar Morling
*/
public class PlatformResourceBundleLocator implements ResourceBundleLocator {

private static final Log log = LoggerFactory.make();
private static final Logger log = Logger.getLogger( PlatformResourceBundleLocator.class.getName() );
private String bundleName;

public PlatformResourceBundleLocator(String bundleName) {
Expand Down

0 comments on commit 9373be7

Please sign in to comment.