ruper2/src/java/core/org/krysalis/ruper/util/text Messages.java,1.2,1.3

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/text
In directory sc8-pr-cvs1:/tmp/cvs-serv5134/src/java/core/org/krysalis/ruper/util/text

Modified Files:
	Messages.java 
Log Message:
1) Finished Query & Query Engine
2) Worked on Files

Index: Messages.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper/util/text/Messages.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Messages.java	5 Sep 2003 05:51:47 -0000	1.2
--- Messages.java	8 Sep 2003 23:21:40 -0000	1.3
***************
*** 17,22 ****
  public class Messages {
  	/** Map from message code to MessageFormat object for the message. */
! 	private static Map m_messages = new HashMap();
! 	private static ResourceBundle m_resources;
  
  	private Messages() {
--- 17,22 ----
  public class Messages {
  	/** Map from message code to MessageFormat object for the message. */
! 	private static Map l_messages = new HashMap();
! 	private static ResourceBundle l_resources;
  
  	private Messages() {
***************
*** 63,81 ****
  		}
  		catch (final MissingResourceException mre) {
! 			formatted = "Code [" + code + "] "+ getParameterString(params);
  		}
  
  		return formatted;
  	}
! 	
  	public static String getParameterString(final Object[] params) {
  		StringBuffer paramStr = new StringBuffer();
! 		
! 		for ( int i = 0; i < params.length; ++i ) {
! 			paramStr.append(params[i].toString());
! 			if ( i < (params.length-1))
  				paramStr.append(' ');
  		}
! 		
  		return paramStr.toString();
  	}
--- 63,82 ----
  		}
  		catch (final MissingResourceException mre) {
! 			formatted = "Code [" + code + "] " + getParameterString(params);
  		}
  
  		return formatted;
  	}
! 
  	public static String getParameterString(final Object[] params) {
  		StringBuffer paramStr = new StringBuffer();
! 
! 		for (int i = 0; i < params.length; ++i) {
! 			paramStr.append(
! 				(null != params[i]) ? params[i].toString() : "null");
! 			if (i < (params.length - 1))
  				paramStr.append(' ');
  		}
! 
  		return paramStr.toString();
  	}
***************
*** 87,110 ****
  		throws MissingResourceException {
  		// Check if the message is cached
! 		MessageFormat msg = (MessageFormat) m_messages.get(code);
  		if (msg != null)
  			return msg;
  
  		// Locate the message resources
! 		if (m_resources == null) {
  			try {
! 				m_resources =
  					ResourceBundle.getBundle("org.krysalis.ruper.Resources");
  			}
  			catch (Exception e) {
! 				m_resources = null;
  			}
  		}
  
  		// Locate the message format
! 		if (null != m_resources) {
! 			final String msgText = m_resources.getString(code);
  			msg = new MessageFormat(msgText);
! 			m_messages.put(code, msg);
  			return msg;
  		}
--- 88,111 ----
  		throws MissingResourceException {
  		// Check if the message is cached
! 		MessageFormat msg = (MessageFormat) l_messages.get(code);
  		if (msg != null)
  			return msg;
  
  		// Locate the message resources
! 		if (l_resources == null) {
  			try {
! 				l_resources =
  					ResourceBundle.getBundle("org.krysalis.ruper.Resources");
  			}
  			catch (Exception e) {
! 				l_resources = null;
  			}
  		}
  
  		// Locate the message format
! 		if (null != l_resources) {
! 			final String msgText = l_resources.getString(code);
  			msg = new MessageFormat(msgText);
! 			l_messages.put(code, msg);
  			return msg;
  		}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.