shims/qpid-jms/src/main/java/org/apache/qpid/interop_test/jms_hdrs_props_test/Sender.java [440:477]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected static Serializable createJavaObject(String className, String testValue) throws Exception {
        Serializable obj = null;
        try {
            Class<?> c = Class.forName(className);
            if (className.compareTo("java.lang.Character") == 0) {
                Constructor ctor = c.getConstructor(char.class);
                if (testValue.length() == 1) {
                    // Use first character of string
                    obj = (Serializable)ctor.newInstance(testValue.charAt(0));
                } else if (testValue.length() == 4 || testValue.length() == 6) {
                    // Format '\xNN' or '\xNNNN'
                    obj = (Serializable)ctor.newInstance((char)Integer.parseInt(testValue.substring(2), 16));
                } else {
                    throw new Exception("JmsSenderShim.createJavaObject(): Malformed char string: \"" + testValue + "\"");
                }
            } else {
                // Use string constructor
                Constructor ctor = c.getConstructor(String.class);
                obj = (Serializable)ctor.newInstance(testValue);
            }
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace(System.out);
        }
        catch (NoSuchMethodException e) {
            e.printStackTrace(System.out);
        }
        catch (InstantiationException e) {
            e.printStackTrace(System.out);
        }
        catch (IllegalAccessException e) {
            e.printStackTrace(System.out);
        }
        catch (InvocationTargetException e) {
            e.printStackTrace(System.out);
        }
        return obj;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



shims/qpid-jms/src/main/java/org/apache/qpid/interop_test/jms_messages_test/Sender.java [337:374]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected static Serializable createJavaObject(String className, String testValue) throws Exception {
        Serializable obj = null;
        try {
            Class<?> c = Class.forName(className);
            if (className.compareTo("java.lang.Character") == 0) {
                Constructor<?> ctor = c.getConstructor(char.class);
                if (testValue.length() == 1) {
                    // Use first character of string
                    obj = (Serializable)ctor.newInstance(testValue.charAt(0));
                } else if (testValue.length() == 4 || testValue.length() == 6) {
                    // Format '\xNN' or '\xNNNN'
                    obj = (Serializable)ctor.newInstance((char)Integer.parseInt(testValue.substring(2), 16));
                } else {
                    throw new Exception("JmsSenderShim.createJavaObject(): Malformed char string: \"" + testValue + "\"");
                }
            } else {
                // Use string constructor
                Constructor<?> ctor = c.getConstructor(String.class);
                obj = (Serializable)ctor.newInstance(testValue);
            }
        }
        catch (ClassNotFoundException e) {
            e.printStackTrace(System.out);
        }
        catch (NoSuchMethodException e) {
            e.printStackTrace(System.out);
        }
        catch (InstantiationException e) {
            e.printStackTrace(System.out);
        }
        catch (IllegalAccessException e) {
            e.printStackTrace(System.out);
        }
        catch (InvocationTargetException e) {
            e.printStackTrace(System.out);
        }
        return obj;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



