File: 0009_hibernate_validator_41.diff

package info (click to toggle)
libspring-java 3.0.6.RELEASE-17
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 50,744 kB
  • ctags: 58,990
  • sloc: java: 325,579; xml: 67,955; sql: 176; makefile: 40; ruby: 33; sh: 6
file content (101 lines) | stat: -rw-r--r-- 4,542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Description: Remove some code which only compile with Hibernate Validator 4.1
 This should be re-enabled when Hibernate Validator 4.1 enter Debian.
Author: Damien Raude-Morvan <drazzib@debian.org>
Forwarded: not-needed
Last-Update: 2010-08-24
Index: libspring-java/projects/org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java
===================================================================
--- libspring-java.orig/projects/org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java	2010-10-20 16:29:40.000000000 -0430
+++ libspring-java/projects/org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.java	2010-11-05 16:06:32.000000000 -0430
@@ -30,7 +30,7 @@
 import javax.validation.ValidatorFactory;
 import javax.validation.spi.ValidationProvider;
 
-import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator;
+//import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator;
 
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.context.ApplicationContext;
@@ -113,7 +113,7 @@
 	 * @see MessageSourceResourceBundleLocator
 	 */
 	public void setValidationMessageSource(MessageSource messageSource) {
-		this.messageInterpolator = HibernateValidatorDelegate.buildMessageInterpolator(messageSource);
+		//this.messageInterpolator = HibernateValidatorDelegate.buildMessageInterpolator(messageSource);
 	}
 
 	/**
@@ -245,11 +245,11 @@
 	/**
 	 * Inner class to avoid a hard-coded Hibernate Validator 4.1 dependency.
 	 */
-	private static class HibernateValidatorDelegate {
+	/*private static class HibernateValidatorDelegate {
 
 		public static MessageInterpolator buildMessageInterpolator(MessageSource messageSource) {
 			return new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(messageSource));
 		}
-	}
+	}*/
 
 }
Index: libspring-java/projects/org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/MessageSourceResourceBundleLocator.java
===================================================================
--- libspring-java.orig/projects/org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/MessageSourceResourceBundleLocator.java	2010-10-20 16:29:40.000000000 -0430
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.validation.beanvalidation;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.hibernate.validator.resourceloading.ResourceBundleLocator;
-
-import org.springframework.context.MessageSource;
-import org.springframework.context.support.MessageSourceResourceBundle;
-import org.springframework.util.Assert;
-
-/**
- * Implementation of Hibernate Validator 4.1's {@link ResourceBundleLocator} interface,
- * exposing a Spring {@link MessageSource} as localized {@link MessageSourceResourceBundle}.
- *
- * @author Juergen Hoeller
- * @since 3.0.4
- * @see ResourceBundleLocator
- * @see MessageSource
- * @see MessageSourceResourceBundle
- */
-public class MessageSourceResourceBundleLocator implements ResourceBundleLocator {
-
-	private final MessageSource messageSource;
-
-	/**
-	 * Build a MessageSourceResourceBundleLocator for the given MessageSource.
-	 * @param messageSource the Spring MessageSource to wrap
-	 */
-	public MessageSourceResourceBundleLocator(MessageSource messageSource) {
-		Assert.notNull(messageSource, "MessageSource must not be null");
-		this.messageSource = messageSource;
-	}
-
-	public ResourceBundle getResourceBundle(Locale locale) {
-		return new MessageSourceResourceBundle(this.messageSource, locale);
-	}
-
-}