[jsword-svn] common/java/core/org/crosswire/common/util s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Sat Jan 15 05:05:35 MST 2005
Update of /cvs/jsword/common/java/core/org/crosswire/common/util
In directory www.crosswire.org:/tmp/cvs-serv31101/java/core/org/crosswire/common/util
Modified Files:
LucidException.java LucidRuntimeException.java NetUtil.java
CallContext.java
Log Message:
general tidy-ups
Index: LucidRuntimeException.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/LucidRuntimeException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** LucidRuntimeException.java 16 Aug 2004 22:07:35 -0000 1.3
--- LucidRuntimeException.java 15 Jan 2005 12:05:33 -0000 1.4
***************
*** 13,17 ****
* before you used it, however EventExceptions would be used directly.
* </p>
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 13,17 ----
* before you used it, however EventExceptions would be used directly.
* </p>
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 79,83 ****
super(msg.toString(), cause);
! this.params = params;
}
--- 79,83 ----
super(msg.toString(), cause);
! this.params = (Object[]) params.clone();
}
***************
*** 101,106 ****
catch (IllegalArgumentException ex)
{
! log.warn("Format fail for '" + out + "'", ex); //$NON-NLS-1$ //$NON-NLS-2$
! return "Error formatting message '" + out + "'"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
--- 101,106 ----
catch (IllegalArgumentException ex)
{
! log.warn("Format fail for '" + out + '\'', ex); //$NON-NLS-1$
! return "Error formatting message '" + out + '\''; //$NON-NLS-1$
}
}
Index: LucidException.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/LucidException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** LucidException.java 16 Aug 2004 22:07:35 -0000 1.4
--- LucidException.java 15 Jan 2005 12:05:33 -0000 1.5
***************
*** 88,92 ****
super(msg.toString(), cause);
this.deprecated = false;
! this.params = params;
}
--- 88,92 ----
super(msg.toString(), cause);
this.deprecated = false;
! this.params = (Object[]) params.clone();
}
***************
*** 110,115 ****
catch (IllegalArgumentException ex)
{
! log.warn("Format fail for '" + out + "'", ex); //$NON-NLS-1$ //$NON-NLS-2$
! return "Error formatting message '" + out + "'"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
--- 110,115 ----
catch (IllegalArgumentException ex)
{
! log.warn("Format fail for '" + out + '\'', ex); //$NON-NLS-1$
! return "Error formatting message '" + out + '\''; //$NON-NLS-1$
}
}
Index: NetUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/NetUtil.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** NetUtil.java 15 Oct 2004 23:28:17 -0000 1.15
--- NetUtil.java 15 Jan 2005 12:05:33 -0000 1.16
***************
*** 16,19 ****
--- 16,20 ----
import java.util.Arrays;
import java.util.List;
+ import java.util.Date;
import java.util.jar.JarEntry;
***************
*** 502,506 ****
// with #, not the index file itself and acceptable by the filter.
if (name.length() > 0
! && !name.startsWith("#") //$NON-NLS-1$
&& !name.equals(INDEX_FILE)
&& filter.accept(name))
--- 503,507 ----
// with #, not the index file itself and acceptable by the filter.
if (name.length() > 0
! && name.charAt(0) != '#'
&& !name.equals(INDEX_FILE)
&& filter.accept(name))
***************
*** 537,571 ****
public static long getLastModified(URL url)
{
- long time = 0;
- URLConnection urlConnection = null;
try
{
! urlConnection = url.openConnection();
! time = urlConnection.getLastModified();
! }
! catch (IOException e)
! {
! // TODO Auto-generated catch block
! e.printStackTrace();
! }
! // If it were a jar then time contains the last modified date of the jar.
! if (urlConnection instanceof JarURLConnection)
! {
! // form is jar:file:.../xxx.jar!.../filename.ext
! JarURLConnection jarConnection = (JarURLConnection) urlConnection;
! JarEntry jarEntry = null;
! try
! {
! jarEntry = jarConnection.getJarEntry();
! }
! catch (IOException e2)
{
! assert false;
}
- time = jarEntry.getTime();
- }
! return time;
}
--- 538,562 ----
public static long getLastModified(URL url)
{
try
{
! URLConnection urlConnection = url.openConnection();
! long time = urlConnection.getLastModified();
! // If it were a jar then time contains the last modified date of the jar.
! if (urlConnection instanceof JarURLConnection)
{
! // form is jar:file:.../xxx.jar!.../filename.ext
! JarURLConnection jarConnection = (JarURLConnection) urlConnection;
! JarEntry jarEntry = jarConnection.getJarEntry();
! time = jarEntry.getTime();
}
! return time;
! }
! catch (IOException ex)
! {
! log.warn("Failed to get modified time", ex); //$NON-NLS-1$
! return new Date().getTime();
! }
}
***************
*** 652,656 ****
log.error("Failed to create URL", ex); //$NON-NLS-1$
assert false;
! throw new IllegalArgumentException();
}
}
--- 643,647 ----
log.error("Failed to create URL", ex); //$NON-NLS-1$
assert false;
! throw new IllegalArgumentException(ex.toString());
}
}
***************
*** 695,699 ****
* Where are temporary files cached.
*/
! private static File cachedir;
/**
--- 686,690 ----
* Where are temporary files cached.
*/
! private static File cachedir = null;
/**
Index: CallContext.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/CallContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CallContext.java 8 Sep 2004 19:54:24 -0000 1.2
--- CallContext.java 15 Jan 2005 12:05:33 -0000 1.3
***************
*** 6,10 ****
* <p>
* It has been tested to work in command line and WebStart environments.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 6,10 ----
* <p>
* It has been tested to work in command line and WebStart environments.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 91,98 ****
* Offset needed to represent the caller of the method
* that called this method.
! *
*/
private static final int CALL_CONTEXT_OFFSET = 3;
! private static CallContext resolver;
}
--- 91,98 ----
* Offset needed to represent the caller of the method
* that called this method.
! *
*/
private static final int CALL_CONTEXT_OFFSET = 3;
! private static CallContext resolver = null;
}
More information about the jsword-svn
mailing list