Skip to content

Commit

Permalink
Tab police
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1390989 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
sebbASF committed Sep 27, 2012
1 parent aa3209a commit 03d4267
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<pathelement location="${build.home}/classes"/> <pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/> <pathelement location="${build.home}/tests"/>
<pathelement location="${junit.jar}"/> <pathelement location="${junit.jar}"/>
<pathelement location="${easymock.jar}"/> <pathelement location="${easymock.jar}"/>
<pathelement location="${commons-io.jar}"/> <pathelement location="${commons-io.jar}"/>
</path> </path>


<!-- ========== Executable Targets ======================================== --> <!-- ========== Executable Targets ======================================== -->
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/org/apache/commons/lang3/time/FastDateParser.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected FastDateParser(String pattern, TimeZone timeZone, Locale locale) {
*/ */
private void init() { private void init() {
Calendar definingCalendar = Calendar.getInstance(timeZone, locale); Calendar definingCalendar = Calendar.getInstance(timeZone, locale);
thisYear= definingCalendar.get(Calendar.YEAR); thisYear= definingCalendar.get(Calendar.YEAR);


StringBuilder regex= new StringBuilder(); StringBuilder regex= new StringBuilder();
List<Strategy> collector = new ArrayList<Strategy>(); List<Strategy> collector = new ArrayList<Strategy>();
Expand Down Expand Up @@ -460,7 +460,7 @@ private Strategy getStrategy(String formatField, Calendar definingCalendar) {
return formatField.length()>2 ?LITERAL_YEAR_STRATEGY :ABBREVIATED_YEAR_STRATEGY; return formatField.length()>2 ?LITERAL_YEAR_STRATEGY :ABBREVIATED_YEAR_STRATEGY;
case 'Z': case 'Z':
case 'z': case 'z':
return getLocaleSpecificStrategy(Calendar.ZONE_OFFSET, definingCalendar); return getLocaleSpecificStrategy(Calendar.ZONE_OFFSET, definingCalendar);
} }
} }


Expand All @@ -473,12 +473,12 @@ private Strategy getStrategy(String formatField, Calendar definingCalendar) {
* @return a cache of Locale to Strategy * @return a cache of Locale to Strategy
*/ */
private static ConcurrentMap<Locale, Strategy> getCache(int field) { private static ConcurrentMap<Locale, Strategy> getCache(int field) {
synchronized(caches) { synchronized(caches) {
if(caches[field]==null) { if(caches[field]==null) {
caches[field]= new ConcurrentHashMap<Locale,Strategy>(3); caches[field]= new ConcurrentHashMap<Locale,Strategy>(3);
} }
return caches[field]; return caches[field];
} }
} }


/** /**
Expand All @@ -489,12 +489,12 @@ private static ConcurrentMap<Locale, Strategy> getCache(int field) {
* @return a TextStrategy for the field and Locale * @return a TextStrategy for the field and Locale
*/ */
private Strategy getLocaleSpecificStrategy(int field, Calendar definingCalendar) { private Strategy getLocaleSpecificStrategy(int field, Calendar definingCalendar) {
ConcurrentMap<Locale,Strategy> cache = getCache(field); ConcurrentMap<Locale,Strategy> cache = getCache(field);
Strategy strategy= cache.get(Integer.valueOf(field)); Strategy strategy= cache.get(Integer.valueOf(field));
if(strategy==null) { if(strategy==null) {
strategy= field==Calendar.ZONE_OFFSET strategy= field==Calendar.ZONE_OFFSET
? new TimeZoneStrategy(locale) ? new TimeZoneStrategy(locale)
: new TextStrategy(field, definingCalendar, locale); : new TextStrategy(field, definingCalendar, locale);
Strategy inCache= cache.putIfAbsent(locale, strategy); Strategy inCache= cache.putIfAbsent(locale, strategy);
if(inCache!=null) { if(inCache!=null) {
return inCache; return inCache;
Expand All @@ -503,7 +503,7 @@ private Strategy getLocaleSpecificStrategy(int field, Calendar definingCalendar)
return strategy; return strategy;
} }


/** /**
* A strategy that copies the static or quoted field in the parsing pattern * A strategy that copies the static or quoted field in the parsing pattern
*/ */
private static class CopyQuotedStrategy implements Strategy { private static class CopyQuotedStrategy implements Strategy {
Expand Down Expand Up @@ -546,7 +546,7 @@ public void setCalendar(FastDateParser parser, Calendar cal, String value) {
} }
} }


/** /**
* A strategy that handles a text field in the parsing pattern * A strategy that handles a text field in the parsing pattern
*/ */
private static class TextStrategy implements Strategy { private static class TextStrategy implements Strategy {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public class StringUtilsTest {
private static final String[] EMPTY_ARRAY_LIST = {}; private static final String[] EMPTY_ARRAY_LIST = {};
private static final String[] NULL_ARRAY_LIST = {null}; private static final String[] NULL_ARRAY_LIST = {null};
private static final Object[] NULL_TO_STRING_LIST = { private static final Object[] NULL_TO_STRING_LIST = {
new Object(){ new Object(){
@Override @Override
public String toString() { public String toString() {
return null; return null;
} }
} }
}; };
private static final String[] MIXED_ARRAY_LIST = {null, "", "foo"}; private static final String[] MIXED_ARRAY_LIST = {null, "", "foo"};
private static final Object[] MIXED_TYPE_LIST = {"foo", Long.valueOf(2L)}; private static final Object[] MIXED_TYPE_LIST = {"foo", Long.valueOf(2L)};
Expand Down

0 comments on commit 03d4267

Please sign in to comment.