diff options
author | Martin Ritchie <ritchiem@apache.org> | 2008-12-17 11:34:33 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2008-12-17 11:34:33 +0000 |
commit | 8d4732ea2190dd8ddc7869fc263ba4c592c97d86 (patch) | |
tree | 6c6b70fe6f658bcd60f94b4fd0134a2b8dd77790 | |
parent | 69e2032f10cffc877f8183454ad01bce92fae774 (diff) | |
download | qpid-python-8d4732ea2190dd8ddc7869fc263ba4c592c97d86.tar.gz |
QPID-1471 : Simplist patch to correct argument type mismatch. An improved solution can be addressed later
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@727346 13f79535-47bb-0310-9956-ffa450edef68
4 files changed, 43 insertions, 40 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java index 6426a91e59..36ad1b4fdc 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java @@ -606,25 +606,19 @@ public class OperationTabControl extends TabControl } // customized for passwords - String securityMechanism = ""; - ServerRegistry serverReg = ApplicationRegistry.getServerRegistry(_mbean); - - if (serverReg instanceof JMXServerRegistry) - { - JMXServerRegistry jmxServerReg = (JMXServerRegistry) ApplicationRegistry.getServerRegistry(_mbean); - securityMechanism = jmxServerReg.getSecurityMechanism(); - } - - if ((MECH_CRAMMD5.equals(securityMechanism)) && PASSWORD.equalsIgnoreCase(param.getName())) + if (PASSWORD.equalsIgnoreCase(param.getName())) { - try - { - param.setValue(ViewUtility.getMD5HashedCharArray(param.getValue())); - } - catch (Exception ex) + if (param.getType().equals("[C")) { - MBeanUtility.handleException(_mbean, ex); - return; + try + { + param.setValue(ViewUtility.getHash((String)param.getValue())); + } + catch (Exception ex) + { + MBeanUtility.handleException(_mbean, ex); + return; + } } } // end of customization diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java index 3245f394b5..5d6a03b238 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java @@ -536,29 +536,7 @@ public class ViewUtility { oldControls[i].dispose(); } - } - - public static char[] getMD5HashedCharArray(Object text) throws NoSuchAlgorithmException, UnsupportedEncodingException - { - byte[] data = ((String)text).getBytes("utf-8"); - - MessageDigest md = MessageDigest.getInstance("MD5"); - - for (byte b : data) - { - md.update(b); - } - - byte[] digest = md.digest(); - - char[] byteArray = new char[digest.length]; - int index = 0; - for (byte b : digest) - { - byteArray[index++] = (char)b; - } - return byteArray; - } + } public static char[] getHash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException { diff --git a/qpid/java/management/eclipse-plugin/workspace/.metadata/.log b/qpid/java/management/eclipse-plugin/workspace/.metadata/.log new file mode 100644 index 0000000000..4e0f26893f --- /dev/null +++ b/qpid/java/management/eclipse-plugin/workspace/.metadata/.log @@ -0,0 +1,28 @@ +!SESSION Wed Dec 17 10:39:13 GMT 2008 ------------------------------------------ +!ENTRY org.eclipse.core.launcher 4 0 2008-12-17 10:39:13.784 +!MESSAGE -showsplash +!STACK +java.lang.NullPointerException + at java.lang.ProcessBuilder.start(ProcessBuilder.java:441) + at java.lang.Runtime.exec(Runtime.java:593) + at java.lang.Runtime.exec(Runtime.java:466) + at org.eclipse.core.launcher.Main.runCommand(Main.java:1569) + at org.eclipse.core.launcher.Main.handleSplash(Main.java:1545) + at org.eclipse.core.launcher.Main.basicRun(Main.java:278) + at org.eclipse.core.launcher.Main.run(Main.java:977) + at org.eclipse.core.launcher.Main.main(Main.java:952) + +!SESSION Wed Dec 17 10:53:51 GMT 2008 ------------------------------------------ +!ENTRY org.eclipse.core.launcher 4 0 2008-12-17 10:53:51.375 +!MESSAGE -showsplash +!STACK +java.lang.NullPointerException + at java.lang.ProcessBuilder.start(ProcessBuilder.java:441) + at java.lang.Runtime.exec(Runtime.java:593) + at java.lang.Runtime.exec(Runtime.java:466) + at org.eclipse.core.launcher.Main.runCommand(Main.java:1569) + at org.eclipse.core.launcher.Main.handleSplash(Main.java:1545) + at org.eclipse.core.launcher.Main.basicRun(Main.java:278) + at org.eclipse.core.launcher.Main.run(Main.java:977) + at org.eclipse.core.launcher.Main.main(Main.java:952) + diff --git a/qpid/java/management/eclipse-plugin/workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/qpid/java/management/eclipse-plugin/workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000000..5ca0b77690 --- /dev/null +++ b/qpid/java/management/eclipse-plugin/workspace/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<section name="Workbench"> +</section> |