[jsword-svn] common/java/core/org/crosswire/common/util s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sat Oct 2 16:50:55 MST 2004


Update of /cvs/jsword/common/java/core/org/crosswire/common/util
In directory www.crosswire.org:/tmp/cvs-serv19597/java/core/org/crosswire/common/util

Modified Files:
	ResourceUtil.java PatternFormatter.java 
Log Message:
advanced search and a-a option.

Index: PatternFormatter.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/PatternFormatter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PatternFormatter.java	21 Sep 2004 17:45:47 -0000	1.2
--- PatternFormatter.java	2 Oct 2004 23:50:53 -0000	1.3
***************
*** 3,6 ****
--- 3,7 ----
  import java.io.PrintWriter;
  import java.io.StringWriter;
+ import java.security.AccessController;
  import java.text.MessageFormat;
  import java.util.Date;
***************
*** 8,11 ****
--- 9,15 ----
  import java.util.logging.LogManager;
  import java.util.logging.LogRecord;
+ import java.util.logging.Logger;
+ 
+ import sun.security.action.GetPropertyAction;
  
  /**
***************
*** 42,51 ****
   * </font></td></tr></table>
   * @see gnu.gpl.Licence
!  * @author DM Smith [ dmsmith555 at yahoo dot com]
   * @version $Id$
   */
  public class PatternFormatter extends Formatter
  {
- 
      /**
       * Format the given LogRecord.
--- 46,55 ----
   * </font></td></tr></table>
   * @see gnu.gpl.Licence
!  * @author DM Smith [dmsmith555 at yahoo dot com]
!  * @author Joe Walker [joe at eireneh dot com]
   * @version $Id$
   */
  public class PatternFormatter extends Formatter
  {
      /**
       * Format the given LogRecord.
***************
*** 73,87 ****
              }
          }
          String format = LogManager.getLogManager().getProperty(PatternFormatter.class.getName() + ".format"); //$NON-NLS-1$
          String loggerName = record.getLoggerName();
!         java.util.logging.Logger logger = LogManager.getLogManager().getLogger(loggerName);
!         for (java.util.logging.Logger aLogger = logger; aLogger != null; aLogger = aLogger.getParent())
          {
              String property = null;
              String aLoggerName = aLogger.getName();
              if (aLoggerName != null)
              {
                  property = LogManager.getLogManager().getProperty(aLoggerName + ".format"); //$NON-NLS-1$
              }
              if (property != null)
              {
--- 77,95 ----
              }
          }
+ 
          String format = LogManager.getLogManager().getProperty(PatternFormatter.class.getName() + ".format"); //$NON-NLS-1$
          String loggerName = record.getLoggerName();
!         Logger logger = LogManager.getLogManager().getLogger(loggerName);
! 
!         for (Logger aLogger = logger; aLogger != null; aLogger = aLogger.getParent())
          {
              String property = null;
              String aLoggerName = aLogger.getName();
+ 
              if (aLoggerName != null)
              {
                  property = LogManager.getLogManager().getProperty(aLoggerName + ".format"); //$NON-NLS-1$
              }
+ 
              if (property != null)
              {
***************
*** 90,102 ****
              }
          }
          if (format == null)
          {
              format = DEFAULT_FORMAT;
          }
          Object[] args =
          {
!                         dat, record.getLoggerName(), record.getLevel().getLocalizedName(), formatMessage(record), throwable, record.getSourceClassName(),
!                         record.getSourceMethodName(), new Long(record.getSequenceNumber()), lineSeparator
          };
          StringBuffer text = new StringBuffer();
          formatter = new MessageFormat(format);
--- 98,120 ----
              }
          }
+ 
          if (format == null)
          {
              format = DEFAULT_FORMAT;
          }
+ 
          Object[] args =
          {
!             dat,  // 0
!             record.getLoggerName(), // 1
!             record.getLevel().getLocalizedName(), // 2
!             formatMessage(record), // 3
!             throwable, // 4
!             record.getSourceClassName(), // 5
!             record.getSourceMethodName(), // 6
!             new Long(record.getSequenceNumber()), // 7
!             lineSeparator // 8
          };
+ 
          StringBuffer text = new StringBuffer();
          formatter = new MessageFormat(format);
***************
*** 106,115 ****
  
      private Date dat = new Date();
!     private static final String DEFAULT_FORMAT = "{1}({2}): {3}{8}"; //$NON-NLS-1$
      private MessageFormat formatter;
  
      // Line separator string.  This is the value of the line.separator
      // property at the moment that the PatternFormatter was created.
!     private String lineSeparator = (String) java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction("line.separator")); //$NON-NLS-1$
! 
  }
--- 124,132 ----
  
      private Date dat = new Date();
!     private static final String DEFAULT_FORMAT = "{1}({2}): {3}{8} {4}"; //$NON-NLS-1$
      private MessageFormat formatter;
  
      // Line separator string.  This is the value of the line.separator
      // property at the moment that the PatternFormatter was created.
!     private String lineSeparator = (String) AccessController.doPrivileged(new GetPropertyAction("line.separator")); //$NON-NLS-1$
  }

Index: ResourceUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/ResourceUtil.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ResourceUtil.java	21 Sep 2004 17:45:47 -0000	1.6
--- ResourceUtil.java	2 Oct 2004 23:50:53 -0000	1.7
***************
*** 67,71 ****
          if (resource == null)
          {
!             throw new MissingResourceException(Msg.NO_RESOURCE.toString(clazz.getName()), clazz.getName(), resourceName);
          }
  
--- 67,71 ----
          if (resource == null)
          {
!             throw new MissingResourceException(Msg.NO_RESOURCE.toString(resourceName), clazz.getName(), resourceName);
          }
  



More information about the jsword-svn mailing list