Commit Graph

2743 Commits

Author SHA1 Message Date
Henri Yandell 7506eb0511 Removed unused import statements.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137054 13f79535-47bb-0310-9956-ffa450edef68
2002-09-21 05:02:43 +00:00
Henri Yandell 17c61e6bd2 Enhanced documentation files. First take.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137053 13f79535-47bb-0310-9956-ffa450edef68
2002-09-21 04:22:28 +00:00
Stephen Colebourne 32c6231679 Superclass now specifies protected getters and setters
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137051 13f79535-47bb-0310-9956-ffa450edef68
2002-09-19 19:45:22 +00:00
Stephen Colebourne 1aded675b6 Added javadoc
Added protected getters and setters for fields
Made fields private


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137050 13f79535-47bb-0310-9956-ffa450edef68
2002-09-19 19:44:10 +00:00
Stephen Colebourne 4ff3b6c75c Added some javadoc
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137049 13f79535-47bb-0310-9956-ffa450edef68
2002-09-19 19:42:59 +00:00
Henri Yandell bcc5b99ca4 added another test and updated STATUS to confirm containsOnly is done
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137048 13f79535-47bb-0310-9956-ffa450edef68
2002-09-19 07:02:30 +00:00
Henri Yandell d788e182bc Patch from Fredrik Westermarck <fredrik.westermarck@mdh.se> that adds the
containsOnly method. I added a couple more unit tests and modified the code
slightly.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137047 13f79535-47bb-0310-9956-ffa450edef68
2002-09-19 06:58:13 +00:00
Stephen Colebourne 00df256006 Add test for Null placeholder singleton
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137045 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 20:12:15 +00:00
Stephen Colebourne 727c9b0fa4 Add Null placeholder singleton
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137044 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 20:11:53 +00:00
Stephen Colebourne 55ca32bd2e Added explicit public constructor
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137043 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 19:55:32 +00:00
Henri Yandell 06ad5b4b6b And now i'll add a comment about the public constructor.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137042 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 19:53:52 +00:00
Henri Yandell 01a6edec03 Been meaning to do this. Made the constructor public in line with StringUtils.
scolebourne thankfully reminded me by doing NumberUtils :)


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137041 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 19:52:26 +00:00
Stephen Colebourne 46b35c49b1 Test identityToString
Reformat for Suns coding standards


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137039 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 19:49:47 +00:00
Stephen Colebourne a6dfea71c6 Add identityToString
Make constructor public in line with NumberUtils and StringUtils
Javadoc tidy


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137038 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 19:49:08 +00:00
Steven Caswell 593e15d717 added printStackTrace(PrintStream) method to NonThrowableNestable static class to satisfy Nestable interface;
removed deprecated getLength() and indexOfThrowable(int,Class) methods from static test classes;
revised javadocs fof static test classes to be more accurate in describing method behavior


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137037 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 15:51:41 +00:00
Steven Caswell 8bce2df421 change getCause() ExceptionWithoutCause static class:
- changed signature to match getCause method in JDK 1.4 Exception
- changed method to return null


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137036 13f79535-47bb-0310-9956-ffa450edef68
2002-09-18 15:47:44 +00:00
Stephen Colebourne 992105bfd3 Tidy file layout
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137034 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 22:09:11 +00:00
Stephen Colebourne 93bdcee262 Tests for initial checkin of ToStringBuilder and assistants
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137033 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 22:07:50 +00:00
Stephen Colebourne 12c3259745 Initial checkin of ToStringBuilder and assistants
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137032 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 22:07:20 +00:00
Stephen Colebourne aea52bdea5 Exclude static fields from reflection based builder
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137031 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 22:06:38 +00:00
Henri Yandell 3468b1f8e0 Removed the @see ExtensibleEnum as there is no such class in the
system currently. It was giving a warning in the building of javadoc.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137028 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 09:33:28 +00:00
Stephen Colebourne 59a6aaa2b5 Add tests for new min, max and compare methods
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137025 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 10:27:56 +00:00
Stephen Colebourne bb3c2143b4 Test CompareToBuilder
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137024 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 10:27:06 +00:00
Stephen Colebourne bd65b2153e Added compare methods for double and float
Added min/max methods for long
Added public constructor with comment


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137023 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 10:26:42 +00:00
Stephen Colebourne 9a3f8a3e9c Add CompareToBuilder for building compareTo methods
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137022 13f79535-47bb-0310-9956-ffa450edef68
2002-09-15 10:25:22 +00:00
Stephen Colebourne dee1c29975 New builder subpackage created
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137020 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 22:01:25 +00:00
Stephen Colebourne 5cab6528ea Add extra tests for reflection and multi dimensional arrays
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137019 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 22:01:00 +00:00
Stephen Colebourne b47c241280 Added code from Steve Downey,
with some formatting changes and extra tests


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137018 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 22:00:35 +00:00
Stephen Colebourne 8d12cf6b9c Added code from Steve Downey,
with some formatting changes and minor bug fixes


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137017 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 22:00:00 +00:00
Stephen Colebourne e4da822d41 Moved from superpackage
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137016 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 21:59:01 +00:00
Stephen Colebourne a9af49e61d Moved to builder subpackage
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137015 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 21:58:38 +00:00
Steven Caswell 3c58a13269 added printStackTrace(PrintStream) for consistency with printStackTrace(PrintWriter)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137013 13f79535-47bb-0310-9956-ffa450edef68
2002-09-12 01:20:25 +00:00
Steven Caswell c0b40b9c77 corrected name of test case class
corrected name of second tester class in getTester2 method


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137012 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 19:40:56 +00:00
Steven Caswell 5adc254330 corrected name of test case class
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137011 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 19:40:35 +00:00
Steven Caswell 8ac7a8a0f4 corrected a couple of refactoring items missed:
- in testGetThrowableI, replaced construction of explicit class instance with getThrowable abstract method
   - in testPrintPartialStackTrace, replaced class name in startsWith assert from explcit class name to class from getNestable abstract method
   - in testPrintStackTrace, replaced class name in startsWith assert from explicit class name to class name from getThrowableClass abstract method
   - in testPrintStackTrace, replaced class name in indexOf assert from explicit class name to class name from getNestable abstract method
removed extranous commented code


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137010 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 19:40:14 +00:00
Steven Caswell d1b1006b66 updated javadocs
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137009 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 19:04:26 +00:00
Steven Caswell 0acf0a6f35 added NestableErrorTestCase to test suite
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137008 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 18:17:42 +00:00
Steven Caswell 51a06ca201 created
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137007 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 18:17:23 +00:00
Steven Caswell 31c87c4b23 refactored to share funcrionality from AbstractNestableTestCase
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137006 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 18:16:53 +00:00
Steven Caswell bb372402d6 created by refactoring NestableException revision 1.3
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137005 13f79535-47bb-0310-9956-ffa450edef68
2002-09-11 18:16:10 +00:00
Stephen Colebourne 3189949155 Removed to sandbox ready for 1.0 release
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137003 13f79535-47bb-0310-9956-ffa450edef68
2002-09-06 22:43:55 +00:00
Henri Yandell 5176b8f7c2 Removed stackTrace and getStackTrace. ExceptionUtils has getStackTrace and
stackTrace is only slightly different in that it uses a ByteArrayOutputStream
and not a StringWriter. A change since the beta, but not allowing obvious ones
to happen will be silly.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137002 13f79535-47bb-0310-9956-ffa450edef68
2002-08-31 19:05:32 +00:00
Stephen Colebourne 3e44b6f86f Improve checkstyle report
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137001 13f79535-47bb-0310-9956-ffa450edef68
2002-08-31 11:11:03 +00:00
Stephen Colebourne dfec8f3aed Improve checkstyle report
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137000 13f79535-47bb-0310-9956-ffa450edef68
2002-08-31 10:51:02 +00:00
Daniel Rall 2257a019e4 split(String, String, int): Integrated some good suggested
improvements from John Yu <john@scioworks.com>.


split(String, String): Referenced split(String, String, int) to avoid
maintainence overhead of duplicated JavaDoc.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136999 13f79535-47bb-0310-9956-ffa450edef68
2002-08-30 02:52:54 +00:00
Daniel Rall 75fd5eaba1 CAUSE_METHOD_NAMES: Added "getSourceException" to list of method
names.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12043


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136997 13f79535-47bb-0310-9956-ffa450edef68
2002-08-26 16:40:43 +00:00
Daniel Rall 7cc9255061 Extend java.lang.Error rather than Exception.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136996 13f79535-47bb-0310-9956-ffa450edef68
2002-08-26 06:03:57 +00:00
Stephen Colebourne f56215806c Add extra system property constants
Add java version methods


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136992 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 22:17:53 +00:00
Daniel Rall 54161dd497 NestableError suggested by Stephen C. Basically a clone of
NestableException.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136991 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 19:18:48 +00:00
Daniel Rall 1f075abae4 Leveraged NestableDelegate.getMessage(String).
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136990 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 19:17:31 +00:00
Daniel Rall 33457071e9 Renamed "cause" private field to "nestable" to better reflect what it
is.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136989 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 19:09:38 +00:00
Daniel Rall 241e24c4d6 getMessage(String): Corrected grammar in JavaDoc.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136988 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 19:02:49 +00:00
Steven Caswell e4125727e7 removed testing of deprecated methods getLength() and indexOfThrowable(int, Class)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136987 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 13:21:24 +00:00
Steven Caswell 1962432bfe removed deprecated methods getLength() and indexOfThrowable(int, Class)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136986 13f79535-47bb-0310-9956-ffa450edef68
2002-08-25 13:20:59 +00:00
Daniel Rall b34534b9d7 ExceptionUtils.getThrowables(Throwable): Switched from concrete
ArrayList local reference to List.

ExceptionUtils.getStackTrace(Throwable): New method for extracting the
text of a stack trace.

ExceptionUtils.getStackFrames(Throwable): Splits an exception's stace
trace into frames.

ExceptionUtils.getStackFrames(String): Splits a stace trace into frames.

NestableDelegate printStackTrace(): Delegate to
printStackTrace(PrintStream) using System.err rather than duplicating
its impl.

NestableDelegate printStackTrace(PrintWriter): Used new name
getStackFrames() method name.

NestableDelegate getStackFrames(Throwable): Renamed decompose() to
this and delegated to ExceptionUtils.getStackFrames(String) for half
of impl.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136985 13f79535-47bb-0310-9956-ffa450edef68
2002-08-24 19:18:50 +00:00
Stephen Colebourne c838670a6f Constrctor made public to enable those who use the class as a Bean
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136984 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 08:00:26 +00:00
Stephen Colebourne 155943d345 Initial version of SystemUtils for system constants
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136983 13f79535-47bb-0310-9956-ffa450edef68
2002-08-22 22:11:25 +00:00
Daniel Rall d659fc0d2a Applied squashing of impl of getThrowableCount(Throwable) to
getThrowables(Throwable).


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136979 13f79535-47bb-0310-9956-ffa450edef68
2002-08-22 00:04:42 +00:00
Daniel Rall 3ad9e1fcc8 Even shorter impl of getThrowableCount(Throwable) which returns zero
when passed a null argument.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136978 13f79535-47bb-0310-9956-ffa450edef68
2002-08-22 00:03:41 +00:00
Daniel Rall e0800963cc testGetThrowableCount(): New method to get
ExceptionUtils.getThrowableCount() with null argument.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136977 13f79535-47bb-0310-9956-ffa450edef68
2002-08-22 00:00:09 +00:00
Daniel Rall 90b54cc01b o Improved getThrowableCount(Throwable) to return zero when passed a
null argument.

o Added @param JavaDoc for methods added during last commit.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136976 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 23:57:00 +00:00
Daniel Rall c5a3bf5fc1 Moved the implementations of getThrowableCount(), getThrowables(),
indexOfThrowable(Class), and indexOfThrowable(Class, int) methods to
ExceptionUtils, as suggested by Stephen Colebourne
<scolebourne@btopenworld.com>.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136975 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 23:52:02 +00:00
Daniel Rall d2b4104bc2 Added the getThrowableCount(Throwable), getThrowables(Throwable),
indexOfThrowable(Throwable, Class), and indexOfThrowable(Throwable,
Class, int) methods factored out of NestableDelegate, as suggested by
Stephen Colebourne <scolebourne@btopenworld.com>.  Added a TODO for
the remaining methods he suggested moving.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136974 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 23:51:22 +00:00
Daniel Rall 0b3f9dcadc Broke long lines; no functional change.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136973 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 07:31:54 +00:00
Daniel Rall 10c9649135 o Changed type of "cause" instance field from Nestable to Throwable.
Since implementation of Throwable is already required, this doesn't
change the interface, but does simplify the internals.

o Simplified code in getThrowableCount() method by removing extraneous
null check and extra reference.

o Implemented suggestion by Joachim.Sauer@tp-soft.com to use
ExceptionUtils where Nestable.getCause() was previously called.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136972 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 07:22:47 +00:00
Daniel Rall 13fecb8398 getCauseUsingWellKnownTypes(Throwable): Collapsed checks for
instanceof NestableException and NestableRuntimeException into single
check for Nestable interface.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136971 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 07:13:50 +00:00
Stephen Colebourne 3e5b0bd6a0 Change HashCodeUtils to HashCodeBuilder
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136970 13f79535-47bb-0310-9956-ffa450edef68
2002-08-15 22:37:30 +00:00
Daniel Rall da49474963 CAUSE_METHOD_PARAMS: Updated JavaDoc for recent API enchancements.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136969 13f79535-47bb-0310-9956-ffa450edef68
2002-08-14 23:16:55 +00:00
Daniel Rall 7004cc6250 CAUSE_METHOD_NAMES: Updated JavaDoc for last commit.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136968 13f79535-47bb-0310-9956-ffa450edef68
2002-08-14 23:15:17 +00:00
Daniel Rall 99ba8f14d5 CAUSE_METHOD_NAMES: Repurposed CAUSE_METHOD_NAME to be a list of
method names which may yield a wrapped exception.

getCause(Throwable): Now just wraps getCause(Throwable, String[]),
passing in CAUSE_METHOD_NAMES as its list of method names.

getCause(Throwable, String[]): Refactored code extracted from
getCause(Throwable) which looks at a list of method names, plus a
"detail" field.

getCauseUsingMethodName(): Swapped parameter order for consistency.

getCauseUsingFieldName(): New method which introspects fields instead
of methods.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136967 13f79535-47bb-0310-9956-ffa450edef68
2002-08-14 23:08:28 +00:00
Daniel Rall 6fdd16815a getCause(Throwable): Refactored into two methods which are called
internally.  This will allow more cause method names to be added with
ease.

getCauseUsingWellKnownTypes(Throwable): Extracted from getCause().

getCauseUsingMethodName(String, Throwable): Extracted from getCause().


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136966 13f79535-47bb-0310-9956-ffa450edef68
2002-08-14 21:05:19 +00:00
Henri Yandell f7c60dc9f6 Checked back in for consideration in 1.0
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136965 13f79535-47bb-0310-9956-ffa450edef68
2002-08-14 04:51:28 +00:00
Daniel Rall f740ef8893 getCause(Throwable): Added detection of SQLException and its
getNextException() method pointed out by Costin M., Paul Jack, and
Nicola Ken Barozzi.  They've also suggested some more general patterns
which we're discussing the addition of on the
commons-dev@jakarta.apache.org list.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136964 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 19:58:49 +00:00
Daniel Rall 72200fffeb getCause(Throwable): Adjusted JavaDoc of method to note the return
type of the getCause() method it checks for.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136963 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 18:19:06 +00:00
Daniel Rall d5525cc4c0 getCause(Throwable): Perform a softer check on the return type of the
argument's getCause() method, doing isAssignableFrom() instead of a
hard memory address comparison.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136962 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 18:17:39 +00:00
Daniel Rall 6053ce341f Added a utility for examining Throwable objects, as proposed by Costin
<costinm@covalent.net> and Henri Yandell <bayard@apache.org>.  Comes complete
with a full suite of tests for initial functionality.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136961 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 18:05:58 +00:00
Stephen Colebourne ce06610103 Add new Enum class (similar to enum in C) plus associated Utils and tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136958 13f79535-47bb-0310-9956-ffa450edef68
2002-08-11 23:17:54 +00:00
Daniel Rall 1ca31bba23 CONSTANT: Adjusted documentation, making it into JavaDoc. Incidently,
this constant could use a more descriptive name which better indicates
its use.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136957 13f79535-47bb-0310-9956-ffa450edef68
2002-08-11 17:52:21 +00:00
Stephen Colebourne 6b2b84f0e7 Add HashCodeUtilsTest
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136955 13f79535-47bb-0310-9956-ffa450edef68
2002-08-10 12:13:28 +00:00
Stephen Colebourne 1c15cb14c0 Test HashCodeUtils - a utility to build good hashCodes
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136954 13f79535-47bb-0310-9956-ffa450edef68
2002-08-10 12:13:10 +00:00
Stephen Colebourne 25508b395d Add HashCodeUtils - a utility to build good hashCodes
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136953 13f79535-47bb-0310-9956-ffa450edef68
2002-08-10 12:12:49 +00:00
Henri Yandell 477290cb92 Added a stackTrace method. Possibly needs renaming. It's in common use in
other Jakarta projects such as Ant. Turns a Throwable into a String.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136952 13f79535-47bb-0310-9956-ffa450edef68
2002-08-01 20:15:43 +00:00
Steven Caswell 58503e7eec updated tests to reflect the following changes:
deprecated method getLength(), replaced with getThrowableCount();
deprecated indexOfThrowable(int, Class), replaced with indexOfThrowable(Class, int) to make signature consistent with other APIs;
changed functionality of methods that receive an index argument to throw an IndexOutOfBoundsException if the index is specified incorrectly, rather than absorbing invalid indices silently, to bring in line with the String API


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136951 13f79535-47bb-0310-9956-ffa450edef68
2002-07-26 20:30:58 +00:00
Steven Caswell e0340c8969 deprecated method getLength(), replaced with getThrowableCount();
deprecated indexOfThrowable(int, Class), replaced with indexOfThrowable(Class, int) to make signature consistent with other APIs;
changed functionality of methods that receive an index argument to throw an IndexOutOfBoundsException if the index is specified incorrectly, rather than absorbing invalid indices silently, to bring in line with the String API
cleaned up javadoc;
rearranged methods alphabetically


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136950 13f79535-47bb-0310-9956-ffa450edef68
2002-07-26 20:30:10 +00:00
Steven Caswell b6302ed270 updated e-maill address for Steven Caswell
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136949 13f79535-47bb-0310-9956-ffa450edef68
2002-07-26 19:46:38 +00:00
Henri Yandell 9182104b3d Changed the javadoc on this one. Randomness stuff came solely from GenJava
library.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136946 13f79535-47bb-0310-9956-ffa450edef68
2002-07-26 14:05:04 +00:00
Daniel Rall e950d9b37e Removed two broken methods from StringUtils. Since a beta has gone out,
this is not good practice.  However, since 1.0 final has not yet been
released, it is out-weighed by the trade off of releasing code that just
plain doesn't work.

Use str.getBytes(encoding) in place of convertUnicodeToNative().

Use new String(byte[], encoding) in place of convertNativeToUnicode().


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136945 13f79535-47bb-0310-9956-ffa450edef68
2002-07-26 01:40:11 +00:00
Henri Yandell 80d827fd89 Added a concatenate method. While this is just a join with a "" delimiter,
the Avalon StringUtil shows that this is a valid way of looking at the
functionality.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136939 13f79535-47bb-0310-9956-ffa450edef68
2002-07-23 05:21:28 +00:00
Henri Yandell 46872f9f52 Moved deleteWhitespace from CharSetUtils to StringUtils.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136938 13f79535-47bb-0310-9956-ffa450edef68
2002-07-21 20:19:50 +00:00
Henri Yandell 97b5ac9b4a Added a deleteWhitespace method as Jakarta.Avalon has a need for this.
Should this go on StringUtils though.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136937 13f79535-47bb-0310-9956-ffa450edef68
2002-07-21 20:14:14 +00:00
Henri Yandell f0a5f0e8aa Added another test to show that I can pass in delimiters that don't appear
in the string I'm stripping.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136935 13f79535-47bb-0310-9956-ffa450edef68
2002-07-19 04:05:57 +00:00
Henri Yandell e488b7b892 stripStart and stripEnd methods changed to fulfill their javadoc.
Passing in strip("-+-+FOO---", "+-") will result in FOO.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136934 13f79535-47bb-0310-9956-ffa450edef68
2002-07-19 04:04:45 +00:00
Henri Yandell 6627f7ad8f Initial copy from jakarta-commons-sandbox
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@136932 13f79535-47bb-0310-9956-ffa450edef68
2002-07-19 03:35:56 +00:00