commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r829405 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/exception/ test/org/apache/commons/lang/exception/
Date Sat, 24 Oct 2009 16:45:43 GMT
Author: scolebourne
Date: Sat Oct 24 16:45:42 2009
New Revision: 829405

URL: http://svn.apache.org/viewvc?rev=829405&view=rev
Log:
Remove references to Labeled in method names as it is unecessary and the spelling looks poor/confusing
in British English

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedException.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedRuntimeException.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/DefaultExceptionContext.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionContext.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedExceptionTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedRuntimeExceptionTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/DefaultExceptionContextTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedException.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedException.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedException.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedException.java
Sat Oct 24 16:45:42 2009
@@ -40,9 +40,9 @@
  *     ...
  *   } catch (Throwable e) {
  *     throw new ContextedException("Error posting account transaction", e)
- *          .addLabeledValue("accountNumber", accountNumber)
- *          .addLabeledValue("amountPosted", amountPosted)
- *          .addLabeledValue("previousBalance", previousBalance)
+ *          .addValue("accountNumber", accountNumber)
+ *          .addValue("amountPosted", amountPosted)
+ *          .addValue("previousBalance", previousBalance)
  *   }
  * }
  * </pre>
@@ -56,7 +56,7 @@
  *  [previousBalance=-2.17]
  *
  *  ---------------------------------
- *  at org.apache.commons.lang.exception.ContextedExceptionTest.testAddLabeledValue(ContextedExceptionTest.java:88)
+ *  at org.apache.commons.lang.exception.ContextedExceptionTest.testAddValue(ContextedExceptionTest.java:88)
  *  ..... (rest of trace)
  * </pre>
  * </p>
@@ -146,8 +146,8 @@
      * @param value  information needed to understand exception, may be null
      * @return this, for method chaining
      */
-    public ContextedException addLabeledValue(String label, Object value) {        
-        exceptionContext.addLabeledValue(label, value);
+    public ContextedException addValue(String label, Object value) {        
+        exceptionContext.addValue(label, value);
         return this;
     }
 
@@ -157,8 +157,8 @@
      * @param label  the label to get the contextual value for, may be null
      * @return the contextual value associated with the label, may be null
      */
-    public Object getLabeledValue(String label) {
-        return exceptionContext.getLabeledValue(label);
+    public Object getValue(String label) {
+        return exceptionContext.getValue(label);
     }
 
     /**

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedRuntimeException.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedRuntimeException.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedRuntimeException.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ContextedRuntimeException.java
Sat Oct 24 16:45:42 2009
@@ -40,9 +40,9 @@
  *     ...
  *   } catch (Throwable e) {
  *     throw new ContextedException("Error posting account transaction", e)
- *          .addLabeledValue("accountNumber", accountNumber)
- *          .addLabeledValue("amountPosted", amountPosted)
- *          .addLabeledValue("previousBalance", previousBalance)
+ *          .addValue("accountNumber", accountNumber)
+ *          .addValue("amountPosted", amountPosted)
+ *          .addValue("previousBalance", previousBalance)
  *   }
  * }
  * </pre>
@@ -56,7 +56,7 @@
  *  [previousBalance=-2.17]
  *
  *  ---------------------------------
- *  at org.apache.commons.lang.exception.ContextedRuntimeExceptionTest.testAddLabeledValue(ContextedExceptionTest.java:88)
+ *  at org.apache.commons.lang.exception.ContextedRuntimeExceptionTest.testAddValue(ContextedExceptionTest.java:88)
  *  ..... (rest of trace)
  * </pre>
  * </p>
@@ -147,8 +147,8 @@
      * @param value  information needed to understand exception, may be null
      * @return this, for method chaining
      */
-    public ContextedRuntimeException addLabeledValue(String label, Object value) {      
 
-        exceptionContext.addLabeledValue(label, value);
+    public ContextedRuntimeException addValue(String label, Object value) {        
+        exceptionContext.addValue(label, value);
         return this;
     }
 
@@ -158,8 +158,8 @@
      * @param label  the label to get the contextual value for, may be null
      * @return the contextual value associated with the label, may be null
      */
-    public Object getLabeledValue(String label) {
-        return exceptionContext.getLabeledValue(label);
+    public Object getValue(String label) {
+        return exceptionContext.getValue(label);
     }
 
     /**

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/DefaultExceptionContext.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/DefaultExceptionContext.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/DefaultExceptionContext.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/DefaultExceptionContext.java
Sat Oct 24 16:45:42 2009
@@ -48,7 +48,7 @@
      * @param value  the value of item to add, may be null
      * @return this, for method chaining
      */
-    public ExceptionContext addLabeledValue(String label, Object value) {        
+    public ExceptionContext addValue(String label, Object value) {        
         contextValueMap.put(label, value);
         return this;
     }
@@ -59,7 +59,7 @@
      * @param label  the label to get the contextual value for, may be null
      * @return the contextual value associated with the label, may be null
      */
-    public Object getLabeledValue(String label) {
+    public Object getValue(String label) {
         return contextValueMap.get(label);
     }
 

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionContext.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionContext.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionContext.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionContext.java
Sat Oct 24 16:45:42 2009
@@ -38,7 +38,7 @@
      * @param value  the value of item to add, may be null
      * @return context itself to allow method chaining
      */
-    public ExceptionContext addLabeledValue(String label, Object value);
+    public ExceptionContext addValue(String label, Object value);
 
     /**
      * Retrieves a contextual data value associated with the label.
@@ -46,7 +46,7 @@
      * @param label  the label to get the contextual value for, may be null
      * @return the contextual value associated with the label, may be null
      */
-    public Object getLabeledValue(String label);
+    public Object getValue(String label);
 
     /**
      * Retrieves the labels defined in the contextual data.

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedExceptionTest.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedExceptionTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedExceptionTest.java
Sat Oct 24 16:45:42 2009
@@ -83,13 +83,13 @@
         assertTrue(message.indexOf(TEST_MESSAGE_2)>=0);
     }
 
-    public void testAddLabeledValue() {
+    public void testAddValue() {
         contextedException = new ContextedException(new Exception(TEST_MESSAGE))
-        .addLabeledValue("test1", null)
-        .addLabeledValue("test2", "some value")
-        .addLabeledValue("test Date", new Date())
-        .addLabeledValue("test Nbr", new Integer(5))
-        .addLabeledValue("test Poorly written obj", new ObjectWithFaultyToString());
+        .addValue("test1", null)
+        .addValue("test2", "some value")
+        .addValue("test Date", new Date())
+        .addValue("test Nbr", new Integer(5))
+        .addValue("test Poorly written obj", new ObjectWithFaultyToString());
         
         String message = contextedException.getMessage();
         assertTrue(message.indexOf(TEST_MESSAGE)>=0);
@@ -102,10 +102,10 @@
         assertTrue(message.indexOf("5")>=0);
         assertTrue(message.indexOf("Crap")>=0);
         
-        assertTrue(contextedException.getLabeledValue("test1") == null);
-        assertTrue(contextedException.getLabeledValue("test2").equals("some value"));
-        assertTrue(contextedException.getLabeledValue("crap") == null);
-        assertTrue(contextedException.getLabeledValue("test Poorly written obj") instanceof
ObjectWithFaultyToString);
+        assertTrue(contextedException.getValue("test1") == null);
+        assertTrue(contextedException.getValue("test2").equals("some value"));
+        assertTrue(contextedException.getValue("crap") == null);
+        assertTrue(contextedException.getValue("test Poorly written obj") instanceof ObjectWithFaultyToString);
         
         assertTrue(contextedException.getLabelSet().size() == 5);
         assertTrue(contextedException.getLabelSet().contains("test1"));
@@ -116,7 +116,7 @@
         
         assertTrue(!contextedException.getLabelSet().contains("crap"));
 
-        contextedException.addLabeledValue("test Poorly written obj", "replacement");
+        contextedException.addValue("test Poorly written obj", "replacement");
         
         String contextMessage = contextedException.getFormattedExceptionMessage(null);
         assertTrue(contextMessage.indexOf(TEST_MESSAGE) == -1);
@@ -125,18 +125,18 @@
     
     public void testNullExceptionPassing() {
         contextedException = new ContextedException(TEST_MESSAGE_2, new Exception(TEST_MESSAGE),
null)
-        .addLabeledValue("test1", null)
-        .addLabeledValue("test2", "some value")
-        .addLabeledValue("test Date", new Date())
-        .addLabeledValue("test Nbr", new Integer(5))
-        .addLabeledValue("test Poorly written obj", new ObjectWithFaultyToString());
+        .addValue("test1", null)
+        .addValue("test2", "some value")
+        .addValue("test Date", new Date())
+        .addValue("test Nbr", new Integer(5))
+        .addValue("test Poorly written obj", new ObjectWithFaultyToString());
         
         String message = contextedException.getMessage();
         assertTrue(message != null);
     }
 
     public void testGetMessage() {
-        testAddLabeledValue();
+        testAddValue();
     }
     
     static class ObjectWithFaultyToString implements Serializable {

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedRuntimeExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedRuntimeExceptionTest.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedRuntimeExceptionTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ContextedRuntimeExceptionTest.java
Sat Oct 24 16:45:42 2009
@@ -83,13 +83,13 @@
         assertTrue(message.indexOf(TEST_MESSAGE_2)>=0);
     }
 
-    public void testAddLabeledValue() {
+    public void testAddValue() {
         contextedRuntimeException = new ContextedRuntimeException(new Exception(TEST_MESSAGE))
-        .addLabeledValue("test1", null)
-        .addLabeledValue("test2", "some value")
-        .addLabeledValue("test Date", new Date())
-        .addLabeledValue("test Nbr", new Integer(5))
-        .addLabeledValue("test Poorly written obj", new ObjectWithFaultyToString());
+        .addValue("test1", null)
+        .addValue("test2", "some value")
+        .addValue("test Date", new Date())
+        .addValue("test Nbr", new Integer(5))
+        .addValue("test Poorly written obj", new ObjectWithFaultyToString());
         
         String message = contextedRuntimeException.getMessage();
         assertTrue(message.indexOf(TEST_MESSAGE)>=0);
@@ -102,10 +102,10 @@
         assertTrue(message.indexOf("5")>=0);
         assertTrue(message.indexOf("Crap")>=0);
         
-        assertTrue(contextedRuntimeException.getLabeledValue("test1") == null);
-        assertTrue(contextedRuntimeException.getLabeledValue("test2").equals("some value"));
-        assertTrue(contextedRuntimeException.getLabeledValue("crap") == null);
-        assertTrue(contextedRuntimeException.getLabeledValue("test Poorly written obj") instanceof
ObjectWithFaultyToString);
+        assertTrue(contextedRuntimeException.getValue("test1") == null);
+        assertTrue(contextedRuntimeException.getValue("test2").equals("some value"));
+        assertTrue(contextedRuntimeException.getValue("crap") == null);
+        assertTrue(contextedRuntimeException.getValue("test Poorly written obj") instanceof
ObjectWithFaultyToString);
         
         assertTrue(contextedRuntimeException.getLabelSet().size() == 5);
         assertTrue(contextedRuntimeException.getLabelSet().contains("test1"));
@@ -116,7 +116,7 @@
         
         assertTrue(!contextedRuntimeException.getLabelSet().contains("crap"));
 
-        contextedRuntimeException.addLabeledValue("test Poorly written obj", "replacement");
+        contextedRuntimeException.addValue("test Poorly written obj", "replacement");
         
         String contextMessage = contextedRuntimeException.getFormattedExceptionMessage(null);
         assertTrue(contextMessage.indexOf(TEST_MESSAGE) == -1);
@@ -125,18 +125,18 @@
     
     public void testNullExceptionPassing() {
         contextedRuntimeException = new ContextedRuntimeException(TEST_MESSAGE_2, new Exception(TEST_MESSAGE),
null)
-        .addLabeledValue("test1", null)
-        .addLabeledValue("test2", "some value")
-        .addLabeledValue("test Date", new Date())
-        .addLabeledValue("test Nbr", new Integer(5))
-        .addLabeledValue("test Poorly written obj", new ObjectWithFaultyToString());
+        .addValue("test1", null)
+        .addValue("test2", "some value")
+        .addValue("test Date", new Date())
+        .addValue("test Nbr", new Integer(5))
+        .addValue("test Poorly written obj", new ObjectWithFaultyToString());
         
         String message = contextedRuntimeException.getMessage();
         assertTrue(message != null);
     }
 
     public void testGetMessage() {
-        testAddLabeledValue();
+        testAddValue();
     }
     
 

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/DefaultExceptionContextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/DefaultExceptionContextTest.java?rev=829405&r1=829404&r2=829405&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/DefaultExceptionContextTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/DefaultExceptionContextTest.java
Sat Oct 24 16:45:42 2009
@@ -38,14 +38,14 @@
     @Override
     public void setUp() {
         defaultExceptionContext = new DefaultExceptionContext()
-        .addLabeledValue("test1", null)
-        .addLabeledValue("test2", "some value")
-        .addLabeledValue("test Date", new Date())
-        .addLabeledValue("test Nbr", new Integer(5))
-        .addLabeledValue("test Poorly written obj", new ObjectWithFaultyToString());
+        .addValue("test1", null)
+        .addValue("test2", "some value")
+        .addValue("test Date", new Date())
+        .addValue("test Nbr", new Integer(5))
+        .addValue("test Poorly written obj", new ObjectWithFaultyToString());
     }
     
-    public void testAddLabeledValue() {
+    public void testAddValue() {
                 
         String message = defaultExceptionContext.getFormattedExceptionMessage("This is an
error");
         assertTrue(message.indexOf("This is an error")>=0);
@@ -66,11 +66,11 @@
         defaultExceptionContext.getFormattedExceptionMessage(null);
     }
     
-    public void testGetLabeledValue() {
-        assertTrue(defaultExceptionContext.getLabeledValue("test1") == null);
-        assertTrue(defaultExceptionContext.getLabeledValue("test2").equals("some value"));
-        assertTrue(defaultExceptionContext.getLabeledValue("crap") == null);
-        assertTrue(defaultExceptionContext.getLabeledValue("test Poorly written obj") instanceof
ObjectWithFaultyToString);
+    public void testGetValue() {
+        assertTrue(defaultExceptionContext.getValue("test1") == null);
+        assertTrue(defaultExceptionContext.getValue("test2").equals("some value"));
+        assertTrue(defaultExceptionContext.getValue("crap") == null);
+        assertTrue(defaultExceptionContext.getValue("test Poorly written obj") instanceof
ObjectWithFaultyToString);
     }
     
     public void testGetLabelSet() {



Mime
View raw message