| ### Eclipse Workspace Patch 1.0 |
| #P org.eclipse.equinox.common |
| Index: src/org/eclipse/core/internal/runtime/LocalizationUtils.java |
| =================================================================== |
| RCS file: /cvsroot/eclipse/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/LocalizationUtils.java,v |
| retrieving revision 1.2 |
| diff -u -r1.2 LocalizationUtils.java |
| --- src/org/eclipse/core/internal/runtime/LocalizationUtils.java 16 Aug 2007 17:23:57 -0000 1.2 |
| +++ src/org/eclipse/core/internal/runtime/LocalizationUtils.java 20 Oct 2007 00:07:32 -0000 |
| @@ -10,47 +10,46 @@ |
| *******************************************************************************/ |
| package org.eclipse.core.internal.runtime; |
| |
| -import java.lang.reflect.Field; |
| - |
| /** |
| * Helper methods related to string localization. |
| - * |
| + * |
| * @since org.eclipse.equinox.common 3.3 |
| */ |
| public class LocalizationUtils { |
| /** |
| - * This method can be used in the absence of NLS class. The method tries to |
| + * This method can be used in the absence of NLS class. The method tries to |
| * use the NLS-based translation routine. If it falls, the method returns the original |
| * non-translated key. |
| - * |
| - * @param key case-sensitive name of the filed in the translation file representing |
| + * |
| + * @param key case-sensitive name of the filed in the translation file representing |
| * the string to be translated |
| * @return The localized message or the non-translated key |
| */ |
| static public String safeLocalize(String key) { |
| - try { |
| - Class messageClass = Class.forName("org.eclipse.core.internal.runtime.CommonMessages"); //$NON-NLS-1$ |
| - if (messageClass == null) |
| - return key; |
| - Field field = messageClass.getDeclaredField(key); |
| - if (field == null) |
| - return key; |
| - Object value = field.get(null); |
| - if (value instanceof String) |
| - return (String) value; |
| - } catch (ClassNotFoundException e) { |
| - // eat exception and fall through |
| - } catch (NoClassDefFoundError e) { |
| - // eat exception and fall through |
| - } catch (SecurityException e) { |
| - // eat exception and fall through |
| - } catch (NoSuchFieldException e) { |
| - // eat exception and fall through |
| - } catch (IllegalArgumentException e) { |
| - // eat exception and fall through |
| - } catch (IllegalAccessException e) { |
| - // eat exception and fall through |
| - } |
| + //FIXME GWT |
| + // try { |
| + // Class messageClass = Class.forName("org.eclipse.core.internal.runtime.CommonMessages"); //$NON-NLS-1$ |
| + // if (messageClass == null) |
| + // return key; |
| + // Field field = messageClass.getDeclaredField(key); |
| + // if (field == null) |
| + // return key; |
| + // Object value = field.get(null); |
| + // if (value instanceof String) |
| + // return (String) value; |
| + // } catch (ClassNotFoundException e) { |
| + // // eat exception and fall through |
| + // } catch (NoClassDefFoundError e) { |
| + // // eat exception and fall through |
| + // } catch (SecurityException e) { |
| + // // eat exception and fall through |
| + // } catch (NoSuchFieldException e) { |
| + // // eat exception and fall through |
| + // } catch (IllegalArgumentException e) { |
| + // // eat exception and fall through |
| + // } catch (IllegalAccessException e) { |
| + // // eat exception and fall through |
| + // } |
| return key; |
| } |
| } |