Commit Graph

2423 Commits

Author SHA1 Message Date
Henri Yandell bc22af91e7 Adding Builder interface, and refactoring the builder classes and BasicThreadFactory to implement this interface. Patch from Michael Wooten in LANG-601
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@925674 13f79535-47bb-0310-9956-ffa450edef68
2010-03-20 20:20:26 +00:00
Henri Yandell 1a60c21395 Applying the copy of the HashCodeBuilder code to stop cyclic references over to EqualsBuilder per LANG-606 and Oliver Sauder's patch
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@925671 13f79535-47bb-0310-9956-ffa450edef68
2010-03-20 20:16:57 +00:00
Oliver Heger cfff2579f5 Switched test class to jUnit 4 style.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@925419 13f79535-47bb-0310-9956-ffa450edef68
2010-03-19 21:08:06 +00:00
Henri Yandell 53d9ad9ffb 'stolen' is a cute word, but given it means taking without permission it's incorrect here
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@924407 13f79535-47bb-0310-9956-ffa450edef68
2010-03-17 18:32:36 +00:00
Henri Yandell dec906e158 Fixing javadoc per LANG-600. Examples already in tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@924372 13f79535-47bb-0310-9956-ffa450edef68
2010-03-17 17:17:45 +00:00
Sebastian Bazley 311dc94070 Tab police (and trailing spaces)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923551 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 02:34:00 +00:00
Gary D. Gregory 2fdfb4a387 Change the APIs from char to int character input to match underlying JRE API called. There is no need to narrow the input type argument to the JRE, in fact this causes us to loose support for Unicode supplementary characters. The APIs changed are:
- indexOf(String, char) -> indexOf(String, int)
- indexOf(String, char, int) -> indexOf(String, int, int)
- lastIndexOf(String, char) -> lastIndexOf(String, int)
- lastIndexOf(String, char, int) -> lastIndexOf(String, int, int)
- contains(String, char) -> contains(String, int) 

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923527 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 00:46:02 +00:00
Gary D. Gregory bc52782cd8 https://issues.apache.org/jira/browse/LANG-607 StringUtils methods do not handle Unicode 2.0+ supplementary characters correctly.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923525 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16 00:37:07 +00:00
Niall Pemberton 79f7a7ef52 Upgrade to commons-parent-14 (and maven-javadoc-plugin 2.5 when specified)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923495 13f79535-47bb-0310-9956-ffa450edef68
2010-03-15 23:10:18 +00:00
Gary D. Gregory 6505531d5c Fix tabs to spaces, thank you Jörg.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923386 13f79535-47bb-0310-9956-ffa450edef68
2010-03-15 18:47:37 +00:00
Joerg Schaible 022d08cfd3 Fix DefaultExceptionContext.addValue that overwrites information in a recursive situation (LANG-605). Allow explicit replacement of a label with the new replaceValue methods.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923341 13f79535-47bb-0310-9956-ffa450edef68
2010-03-15 17:11:55 +00:00
Niall Pemberton 4d7a616cca Update components to point to the new download pages
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923339 13f79535-47bb-0310-9956-ffa450edef68
2010-03-15 17:04:53 +00:00
Gary D. Gregory 646c27b226 Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922912 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 17:45:49 +00:00
Gary D. Gregory a9b61fc427 Back out a CSU experiment.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922911 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 17:44:23 +00:00
Gary D. Gregory 7780fa0ad5 Oops, experiment in progress. Back out last change.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922910 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 17:42:08 +00:00
Gary D. Gregory 5fe2d862fc Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922909 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 17:37:07 +00:00
Gary D. Gregory 5b7817cc3f Fix defaultIsEmpty typing.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922904 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 17:33:23 +00:00
Gary D. Gregory 1ced894df7 https://issues.apache.org/jira/browse/LANG-607 StringUtils.containsAny methods incorrectly matches Unicode 2.0+ supplementary characters.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922703 13f79535-47bb-0310-9956-ffa450edef68
2010-03-14 00:54:03 +00:00
Gary D. Gregory 8a8859cb88 Makes sure "..." is the same all over this method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@922448 13f79535-47bb-0310-9956-ffa450edef68
2010-03-12 22:59:21 +00:00
Gary D. Gregory 655050f6fd Use INDEX_NOT_FOUND instead of magic number.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920546 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 22:22:31 +00:00
Joerg Schaible 7f23ec3d90 ContextedRuntimeException must extend RuntimeException (LANG-602).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920544 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 22:20:12 +00:00
Gary D. Gregory 7cfa8a9328 Change StringUtils arguments from String to CharSequence.
Details: Working with (trunk) StringUtils (SU) I see the following emerge: 

- In SVN already and continuing: Change StringUtils arguments from String to CharSequence (CS).

- This leads to replacing calls to String.substring(int[,int]) with calls to CharSequence.subSequence(int)

- This leads to creating a CharSequenceUtils class (in SVN now, more on this new class below) and CharSequenceUtils.subSequence(CharSequence,int) to avoid changing "str.substring(start)" over and over to "str.subSequence(start, str.length())". For examples, see new versions of capitalize and uncapitalize.

- We end up using a toString() on CharSequence to return a String from StringUtil when working with a CharSequence.

So we have StringUtils using CharSequence inputs as much as possible instead of String, which is nice. 

The CharSequence method subSequence returns a CharSequence; though the Javadoc states "Returns a new CharSequence that is a subsequence of this sequence.", this does not guaranteed the return value to be the same kind of CharSequence as the receiver). Since we are after all in a class called StringUtil, calling toString() is a must.

I propose that we create when possible the methods that are now StringUtils CharSequence methods into CharSequenceUtils and let StringUtil call CharSequenceUtils and then do its toString() and other String specific logic. Later we could have other CharSequence type of utils (for CharBuffer, StringBuiler, StringBuffer, etc) that use the 'primitives' from CharSequenceUtils.
This means that for methods that are based solely on methods that are now in CharSequence, these can be moved to CharSequenceUtils without effort (all is* methods only call CharSequence#length() and charAt() for example and are now typed as CS, still in SU). 

We can leave @deprecateds method in SU as a nicety to avoid too much porting pain: First change the package to lang3 then you can 'optimize' by changing call sites from SU to CSU.

As a start, I put in SVN a CharSequenceUtils (CSU) implementation for length() and subSequence().


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920543 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 22:15:08 +00:00
Gary D. Gregory 9c0379850b Convert defaultIfEmpty from String to CharSequence.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920187 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 03:41:49 +00:00
Niall Pemberton e1077c023d Re-generate the download pages using the new commons-build-plugin .12 (via commons-parent version 13)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920156 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 00:11:50 +00:00
Niall Pemberton 0195cd60c5 Upgrade to version 13 of commons-parent
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@920154 13f79535-47bb-0310-9956-ffa450edef68
2010-03-08 00:05:47 +00:00
Gary D. Gregory 9abfbaecab More tests for length()
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@919872 13f79535-47bb-0310-9956-ffa450edef68
2010-03-06 22:54:34 +00:00
Gary D. Gregory 543f2d36e4 Change length(String) to length(CharSequence)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@919859 13f79535-47bb-0310-9956-ffa450edef68
2010-03-06 22:09:37 +00:00
Henri Yandell f91a7c97d3 Per David M. Sledge's patch to LANG-599, added support to ClassUtils.getClass(String) to support inner classes being separated by '.' as well as the official '$'
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@919340 13f79535-47bb-0310-9956-ffa450edef68
2010-03-05 09:05:47 +00:00
Henri Yandell 51df5ea90c Closing the paragraph tag on the ThreadSafe notation. LANG-370
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918868 13f79535-47bb-0310-9956-ffa450edef68
2010-03-04 06:22:16 +00:00
Sebastian Bazley 18e7603cac Fix threadsafety comments
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918836 13f79535-47bb-0310-9956-ffa450edef68
2010-03-04 03:12:36 +00:00
Sebastian Bazley 26cdd7ba56 Iterator is not threadsafe
Make private field final

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918829 13f79535-47bb-0310-9956-ffa450edef68
2010-03-04 02:57:03 +00:00
Henri Yandell c84c4669aa Some more #ThreadSafe# tags per LANG-370
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918373 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 09:22:46 +00:00
Henri Yandell bb0d189f1b Adding ThreadSafe notes to some obviously threadsafe classes (LANG-370)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918369 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 09:16:38 +00:00
Henri Yandell 36a29645fb Fixing javadoc @see tags
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918368 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 09:09:14 +00:00
Henri Yandell 45488c9826 Adding info on the LANG-559 commits
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918367 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 08:58:10 +00:00
Henri Yandell 4f31ae757c Applying Valentin Rocher's patch from LANG-559, adding isInstanceOf and isAssignableFrom methods.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918366 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 08:56:22 +00:00
Sebastian Bazley 6699e44845 Javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918240 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 23:01:54 +00:00
Sebastian Bazley 52baa809b8 Unused import; missing @Override markers
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918239 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 23:01:40 +00:00
Sebastian Bazley 8e4147b75c Fix raw types
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918238 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 22:55:22 +00:00
Sebastian Bazley 11272085d7 Tab police
Also removed extraneous trailing spaces

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@918237 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 22:52:09 +00:00
Henri Yandell b72207ccf4 Updating package.html files (LANG-490).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@917897 13f79535-47bb-0310-9956-ffa450edef68
2010-03-02 06:58:04 +00:00
Paul C. Benedict Jr 7721acd0ef LANG-594: Add truncatedEquals and truncatedCompareTo
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916906 13f79535-47bb-0310-9956-ffa450edef68
2010-02-27 03:29:43 +00:00
Niall Pemberton e49c05bdce 2.5 changes report should show LANG-348 instead of LANG-438
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916449 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 20:51:17 +00:00
Niall Pemberton 13692fdce3 Add Lang 2.5 release
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916242 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 10:54:19 +00:00
Henri Yandell 90f45b447a Adding toString test. LANG-588
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916099 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 03:11:48 +00:00
Henri Yandell 88d44051a1 Applying Matt's patch with my modifications from LANG-588. Adds a Pair class to Lang.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916098 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 03:04:19 +00:00
Henri Yandell e0ddfa767c Adding BasicThreadFactory class. Same as Oliver's original patch in LANG-582, with an @since 3.0 added
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916095 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 02:53:04 +00:00
Niall Pemberton cf74865561 Update site for 2.5 release
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916082 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 01:29:36 +00:00
Niall Pemberton 43fca0d749 Port @since tags from 2.x branch
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@916081 13f79535-47bb-0310-9956-ffa450edef68
2010-02-25 01:28:13 +00:00
Niall Pemberton 8c16b39c3d Minor javadoc changes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@915111 13f79535-47bb-0310-9956-ffa450edef68
2010-02-22 23:25:21 +00:00