Author: gbrown
Date: Thu Apr 29 11:59:53 2010
New Revision: 939292

URL: http://svn.apache.org/viewvc?rev=939292&view=rev
Log:
Resolve issues PIVOT-483 and PIVOT-486.

Modified:
    pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java

Modified: pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java?rev=939292&r1=939291&r2=939292&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java Thu Apr 29 
11:59:53 2010
@@ -214,7 +214,7 @@ public class BeanAdapter implements Map<
                 try {
                     value = field.get(bean);
                 } catch (IllegalAccessException exception) {
-                    throw new RuntimeException(exception);
+                    throw new RuntimeException("Unable to access property \"" 
+ key + "\".", exception);
                 }
             }
         } else {
@@ -224,9 +224,9 @@ public class BeanAdapter implements Map<
                 try {
                     value = getterMethod.invoke(bean, new Object[] {});
                 } catch (IllegalAccessException exception) {
-                    throw new RuntimeException(exception);
+                    throw new RuntimeException("Unable to access property \"" 
+ key + "\".", exception);
                 } catch (InvocationTargetException exception) {
-                    throw new RuntimeException(exception);
+                    throw new RuntimeException("Unable to access property \"" 
+ key + "\".", exception.getCause());
                 }
             }
         }
@@ -280,7 +280,7 @@ public class BeanAdapter implements Map<
             try {
                 field.set(bean, value);
             } catch (IllegalAccessException exception) {
-                throw new RuntimeException(exception);
+                throw new RuntimeException("Unable to access property \"" + 
key + "\".", exception);
             }
         } else {
             Method setterMethod = null;
@@ -309,15 +309,9 @@ public class BeanAdapter implements Map<
             try {
                 setterMethod.invoke(bean, new Object[] {value});
             } catch (IllegalAccessException exception) {
-                throw new RuntimeException(exception);
+                throw new RuntimeException("Unable to access property \"" + 
key + "\".", exception);
             } catch (InvocationTargetException exception) {
-                Throwable cause = exception.getCause();
-
-                if (cause instanceof RuntimeException) {
-                    throw (RuntimeException)cause;
-                }
-
-                throw new RuntimeException(cause);
+                throw new RuntimeException("Unable to access property \"" + 
key + "\".", exception.getCause());
             }
         }
 
@@ -630,14 +624,14 @@ public class BeanAdapter implements Map<
         Method getterMethod = null;
 
         try {
-            getterMethod = beanClass.getMethod(GET_PREFIX + key, new 
Class<?>[] {});
+            getterMethod = beanClass.getMethod(GET_PREFIX + key);
         } catch (NoSuchMethodException exception) {
             // No-op
         }
 
         if (getterMethod == null) {
             try {
-                getterMethod = beanClass.getMethod(IS_PREFIX + key, new 
Class<?>[] {});
+                getterMethod = beanClass.getMethod(IS_PREFIX + key);
             } catch (NoSuchMethodException exception) {
                 // No-op
             }
@@ -668,7 +662,7 @@ public class BeanAdapter implements Map<
             final String methodName = SET_PREFIX + key;
 
             try {
-                setterMethod = beanClass.getMethod(methodName, new Class<?>[] 
{valueType});
+                setterMethod = beanClass.getMethod(methodName, valueType);
             } catch (NoSuchMethodException exception) {
                 // No-op
             }
@@ -687,14 +681,14 @@ public class BeanAdapter implements Map<
                     Class<?> primitiveValueType = 
(Class<?>)primitiveTypeField.get(null);
 
                     try {
-                        setterMethod = beanClass.getMethod(methodName, new 
Class<?>[] {primitiveValueType});
+                        setterMethod = beanClass.getMethod(methodName, 
primitiveValueType);
                     } catch (NoSuchMethodException exception) {
                         // No-op
                     }
                 } catch (NoSuchFieldException exception) {
                     // No-op
                 } catch (IllegalAccessException exception) {
-                    throw new RuntimeException(exception);
+                    throw new RuntimeException("Unable to access property \"" 
+ key + "\".", exception);
                 }
             }
 

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java?rev=939292&r1=939291&r2=939292&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java Thu Apr 29 11:59:53 
2010
@@ -2023,7 +2023,7 @@ public class TableView extends Component
 
             Dictionary.Pair<String, SortDirection> pair =
                 new Dictionary.Pair<String, 
SortDirection>((String)map.get(COLUMN_NAME_KEY),
-                    
SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toLowerCase()));
+                    
SortDirection.valueOf(((String)map.get(SORT_DIRECTION_KEY)).toUpperCase()));
             sort.add(pair);
         }
 


Reply via email to