You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/06/12 06:24:23 UTC
svn commit: r783978 -
/incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
Author: tvolkert
Date: Fri Jun 12 04:24:22 2009
New Revision: 783978
URL: http://svn.apache.org/viewvc?rev=783978&view=rev
Log:
Changed invocation of __bind() (it should take the serializer, not itself, as an argument), changed "catch()" to "catch ()" per coding conventions
Modified:
incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
Modified: incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java?rev=783978&r1=783977&r2=783978&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtkx/WTKXSerializer.java Fri Jun 12 04:24:22 2009
@@ -314,12 +314,12 @@
Method addMethod = sequence.getClass().getMethod("add",
new Class<?>[] {String.class});
addMethod.invoke(sequence, new Object[] {text});
- } catch(NoSuchMethodException exception) {
+ } catch (NoSuchMethodException exception) {
throw new SerializationException("Text content cannot be added to "
+ sequence.getClass().getName() + ".", exception);
- } catch(InvocationTargetException exception) {
+ } catch (InvocationTargetException exception) {
throw new SerializationException(exception);
- } catch(IllegalAccessException exception) {
+ } catch (IllegalAccessException exception) {
throw new SerializationException(exception);
}
}
@@ -461,7 +461,7 @@
BufferedReader scriptReader = new BufferedReader(new InputStreamReader(scriptLocation.openStream()));
scriptEngine.eval(scriptReader);
- } catch(Exception exception) {
+ } catch (Exception exception) {
throw new SerializationException(exception);
}
@@ -506,7 +506,7 @@
try {
Class<?> type = Class.forName(className);
element = new Element(element, Element.Type.INSTANCE, attributes, type.newInstance());
- } catch(Exception exception) {
+ } catch (Exception exception) {
throw new SerializationException(exception);
}
} else {
@@ -651,7 +651,7 @@
}
reader.close();
- } catch(XMLStreamException exception) {
+ } catch (XMLStreamException exception) {
throw new SerializationException(exception);
}
@@ -802,8 +802,8 @@
Method __bindMethod = null;
try {
- __bindMethod = type.getDeclaredMethod("__bind", new Class<?>[] {type});
- } catch(NoSuchMethodException exception) {
+ __bindMethod = type.getDeclaredMethod("__bind", new Class<?>[] {Dictionary.class});
+ } catch (NoSuchMethodException exception) {
// No-op
}
@@ -826,7 +826,7 @@
if ((fieldModifiers & Modifier.PUBLIC) == 0) {
try {
field.setAccessible(true);
- } catch(SecurityException exception) {
+ } catch (SecurityException exception) {
throw new BindException(fieldName + " is not accessible.");
}
}
@@ -849,11 +849,11 @@
}
} else {
try {
- __bindMethod.invoke(null, new Object[] {object});
- } catch(IllegalAccessException exception) {
- throw new RuntimeException(exception);
- } catch(InvocationTargetException exception) {
- throw new RuntimeException(exception);
+ __bindMethod.invoke(null, new Object[] {this});
+ } catch (IllegalAccessException exception) {
+ throw new BindException(exception);
+ } catch (InvocationTargetException exception) {
+ throw new BindException(exception);
}
}
}
@@ -883,7 +883,7 @@
|| propertyType == Boolean.TYPE) {
try {
resolvedValue = Boolean.parseBoolean(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Character.class
@@ -895,42 +895,42 @@
|| propertyType == Byte.TYPE) {
try {
resolvedValue = Byte.parseByte(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Short.class
|| propertyType == Short.TYPE) {
try {
resolvedValue = Short.parseShort(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Integer.class
|| propertyType == Integer.TYPE) {
try {
resolvedValue = Integer.parseInt(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Long.class
|| propertyType == Long.TYPE) {
try {
resolvedValue = Long.parseLong(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Float.class
|| propertyType == Float.TYPE) {
try {
resolvedValue = Float.parseFloat(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else if (propertyType == Double.class
|| propertyType == Double.TYPE) {
try {
resolvedValue = Double.parseDouble(attributeValue);
- } catch(NumberFormatException exception) {
+ } catch (NumberFormatException exception) {
resolvedValue = attributeValue;
}
} else {
@@ -1001,7 +1001,7 @@
Class<?> propertyClass = null;
try {
propertyClass = Class.forName(propertyClassName);
- } catch(ClassNotFoundException exception) {
+ } catch (ClassNotFoundException exception) {
throw new SerializationException(exception);
}
@@ -1031,7 +1031,7 @@
// Invoke the setter
try {
setterMethod.invoke(null, new Object[] {object, propertyValue});
- } catch(Exception exception) {
+ } catch (Exception exception) {
throw new SerializationException(exception);
}
}
@@ -1044,7 +1044,7 @@
try {
method = propertyClass.getMethod(BeanDictionary.GET_PREFIX
+ propertyName, new Class<?>[] {objectType});
- } catch(NoSuchMethodException exception) {
+ } catch (NoSuchMethodException exception) {
// No-op
}
@@ -1052,7 +1052,7 @@
try {
method = propertyClass.getMethod(BeanDictionary.IS_PREFIX
+ propertyName, new Class<?>[] {objectType});
- } catch(NoSuchMethodException exception) {
+ } catch (NoSuchMethodException exception) {
// No-op
}
}
@@ -1076,7 +1076,7 @@
try {
method = propertyClass.getMethod(methodName,
new Class<?>[] {objectType, propertyValueType});
- } catch(NoSuchMethodException exception) {
+ } catch (NoSuchMethodException exception) {
// No-op
}
@@ -1090,12 +1090,12 @@
try {
method = propertyClass.getMethod(methodName,
new Class<?>[] {objectType, primitivePropertyValueType});
- } catch(NoSuchMethodException exception) {
+ } catch (NoSuchMethodException exception) {
// No-op
}
- } catch(NoSuchFieldException exception) {
+ } catch (NoSuchFieldException exception) {
// No-op; not a wrapper type
- } catch(IllegalAccessException exception) {
+ } catch (IllegalAccessException exception) {
// No-op; not a wrapper type
}
}