Author: hlship
Date: Tue Nov 1 23:11:41 2011
New Revision: 1196375
URL: http://svn.apache.org/viewvc?rev=1196375&view=rev
Log:
Remove class UtilMessages
Removed:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/UtilMessages.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/util/UtilStrings.properties
Modified:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/Stack.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/StrategyRegistry.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/TimeInterval.java
Modified:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/Stack.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/Stack.java?rev=1196375&r1=1196374&r2=1196375&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/Stack.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/Stack.java
Tue Nov 1 23:11:41 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2011 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -116,7 +116,7 @@ public class Stack<E>
private void checkIfEmpty()
{
- if (index < 0) throw new
IllegalStateException(UtilMessages.stackIsEmpty());
+ if (index < 0) throw new IllegalStateException("Stack is empty.");
}
/**
Modified:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/StrategyRegistry.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/StrategyRegistry.java?rev=1196375&r1=1196374&r2=1196375&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/StrategyRegistry.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/StrategyRegistry.java
Tue Nov 1 23:11:41 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2011 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ package org.apache.tapestry5.ioc.util;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InheritanceSearch;
+import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import java.util.Collection;
import java.util.List;
@@ -153,8 +154,8 @@ public final class StrategyRegistry<A>
for (Class t : registrations.keySet())
names.add(t.getName());
- throw new IllegalArgumentException(UtilMessages
- .noStrategyAdapter(type, adapterType, names));
+ throw new IllegalArgumentException(String.format("No adapter from type
%s to type %s is available (registered types are %s).", type.getName(),
adapterType.getName(),
+ InternalUtils.joinSorted(names)));
}
/**
Modified:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/TimeInterval.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/TimeInterval.java?rev=1196375&r1=1196374&r2=1196375&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/TimeInterval.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/util/TimeInterval.java
Tue Nov 1 23:11:41 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2007, 2008, 2010, 2011 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
package org.apache.tapestry5.ioc.util;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
+import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import java.util.Map;
import java.util.regex.Matcher;
@@ -139,7 +140,7 @@ public class TimeInterval
if (lastMatchEnd + 1 < start)
{
String invalid = input.substring(lastMatchEnd + 1, start);
- throw new
RuntimeException(UtilMessages.invalidTimeIntervalInput(invalid, input));
+ throw new RuntimeException(String.format("Unexpected string
'%s' (in time interval '%s').", invalid, input));
}
lastMatchEnd = matcher.end();
@@ -156,7 +157,7 @@ public class TimeInterval
Long unitValue = UNITS.get(units);
if (unitValue == null)
- throw new
RuntimeException(UtilMessages.invalidTimeIntervalUnit(units, input,
UNITS.keySet()));
+ throw new RuntimeException(String.format("Unknown time
interval unit '%s' (in '%s'). Defined units: %s.", units, input,
InternalUtils.joinSorted(UNITS.keySet())));
milliseconds += count * unitValue;
}
@@ -164,7 +165,7 @@ public class TimeInterval
if (lastMatchEnd + 1 < input.length())
{
String invalid = input.substring(lastMatchEnd + 1);
- throw new
RuntimeException(UtilMessages.invalidTimeIntervalInput(invalid, input));
+ throw new RuntimeException(String.format("Unexpected string '%s'
(in time interval '%s').", invalid, input));
}
return milliseconds;