You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2014/12/04 20:46:20 UTC
[2/2] tapestry-5 git commit: TAP5-2422: Include the
MappedConfiguration key in the error message for duplicate contributions
TAP5-2422: Include the MappedConfiguration key in the error message for duplicate contributions
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/9b5e1903
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/9b5e1903
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/9b5e1903
Branch: refs/heads/master
Commit: 9b5e19035f0e779f40231b0275e473c7def1b2cc
Parents: b06c013
Author: Jochen Kemnade <jk...@apache.org>
Authored: Thu Dec 4 20:45:12 2014 +0100
Committer: Jochen Kemnade <jk...@apache.org>
Committed: Thu Dec 4 20:45:12 2014 +0100
----------------------------------------------------------------------
.../main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java | 4 ++--
.../ioc/internal/ValidatingMappedConfigurationWrapper.java | 2 +-
.../org/apache/tapestry5/ioc/internal/IOCStrings.properties | 2 +-
.../ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b5e1903/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
index ac39d15..f3b8388 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/IOCMessages.java
@@ -137,9 +137,9 @@ final class IOCMessages
return MESSAGES.format("generic-type-not-supported", type);
}
- static String contributionDuplicateKey(String serviceId, ContributionDef existingDef)
+ static String contributionDuplicateKey(String serviceId, Object key, ContributionDef existingDef)
{
- return MESSAGES.format("contribution-duplicate-key", serviceId, existingDef);
+ return MESSAGES.format("contribution-duplicate-key", serviceId, key, existingDef);
}
static String errorBuildingService(String serviceId, ServiceDef serviceDef, Throwable cause)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b5e1903/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ValidatingMappedConfigurationWrapper.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ValidatingMappedConfigurationWrapper.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ValidatingMappedConfigurationWrapper.java
index f88c47c..096dcda 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ValidatingMappedConfigurationWrapper.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ValidatingMappedConfigurationWrapper.java
@@ -85,7 +85,7 @@ public class ValidatingMappedConfigurationWrapper<K, V> extends AbstractConfigur
ContributionDef existing = keyToContributor.get(key);
if (existing != null)
- throw new IllegalArgumentException(IOCMessages.contributionDuplicateKey(serviceId, existing));
+ throw new IllegalArgumentException(IOCMessages.contributionDuplicateKey(serviceId, key, existing));
map.put(key, coerced);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b5e1903/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties b/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
index 6710b91..c30c149 100644
--- a/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
+++ b/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/IOCStrings.properties
@@ -43,7 +43,7 @@ contribution-was-null=Service contribution (to service '%s') was null.
contribution-key-was-null=Key for service contribution (to service '%s') was null.
contribution-wrong-key-type=Key for service contribution (to service '%s') was an instance of %s, \
but the expected key type was %s.
-contribution-duplicate-key=Service contribution (to service '%s') conflicts with existing contribution (by %s).
+contribution-duplicate-key=Service contribution (to service '%s') for key '%s' conflicts with existing contribution (by %s).
generic-type-not-supported=Generic type '%s' is not supported. Only simple parameterized lists are \
supported.
error-building-service=Error building service proxy for service '%s' (at %s): %s
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9b5e1903/tapestry-ioc/src/test/groovy/ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy b/tapestry-ioc/src/test/groovy/ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy
index 60241a7..2bc5816 100644
--- a/tapestry-ioc/src/test/groovy/ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy
+++ b/tapestry-ioc/src/test/groovy/ioc/specs/ValidatingMappedConfigurationWrapperSpec.groovy
@@ -97,7 +97,7 @@ class ValidatingMappedConfigurationWrapperSpec extends AbstractSharedRegistrySpe
IllegalArgumentException e = thrown()
- e.message.contains "Service contribution (to service 'Baz') conflicts with existing contribution"
+ e.message.contains "Service contribution (to service 'Baz') for key 'class java.lang.Integer' conflicts with existing contribution"
keyToContribution[Integer].is(def1)
map.isEmpty()