svn commit: r1533345 - in /commons/proper/daemon/branches/1.0.x: RELEASE-NOTES.txt src/native/unix/configure src/native/unix/support/apsupport.m4
Author: mturk Date: Fri Oct 18 07:35:06 2013 New Revision: 1533345 URL: http://svn.apache.org/r1533345 Log: Apply fix for DAEMON-308 Modified: commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt commons/proper/daemon/branches/1.0.x/src/native/unix/configure commons/proper/daemon/branches/1.0.x/src/native/unix/support/apsupport.m4 Modified: commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt?rev=1533345r1=1533344r2=1533345view=diff == --- commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt (original) +++ commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt Fri Oct 18 07:35:06 2013 @@ -84,7 +84,7 @@ NEW FEATURES: BUG FIXES: -1.0.16: DAEMON-289 +1.0.16: DAEMON-289, DAEMON-308 1.0.15: DAEMON-288, DAEMON-291, DAEMON-292 Modified: commons/proper/daemon/branches/1.0.x/src/native/unix/configure URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/unix/configure?rev=1533345r1=1533344r2=1533345view=diff == --- commons/proper/daemon/branches/1.0.x/src/native/unix/configure (original) +++ commons/proper/daemon/branches/1.0.x/src/native/unix/configure Fri Oct 18 07:35:06 2013 @@ -2697,6 +2697,11 @@ echo $as_me: error: Unsupported operati supported_os=arm HOST_CPU=arm ;; + aarch64) +CFLAGS=$CFLAGS -DCPU=\\\aarch64\\\ +supported_os=aarch64 +HOST_CPU=aarch64 +;; *) echo $as_me:$LINENO: result: failed 5 echo ${ECHO_T}failed 6 Modified: commons/proper/daemon/branches/1.0.x/src/native/unix/support/apsupport.m4 URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/unix/support/apsupport.m4?rev=1533345r1=1533344r2=1533345view=diff == --- commons/proper/daemon/branches/1.0.x/src/native/unix/support/apsupport.m4 (original) +++ commons/proper/daemon/branches/1.0.x/src/native/unix/support/apsupport.m4 Fri Oct 18 07:35:06 2013 @@ -179,6 +179,11 @@ AC_DEFUN(AP_SUPPORTED_HOST,[ supported_os=arm HOST_CPU=arm ;; + aarch64) +CFLAGS=$CFLAGS -DCPU=\\\aarch64\\\ +supported_os=aarch64 +HOST_CPU=aarch64 +;; *) AC_MSG_RESULT([failed]) AC_MSG_ERROR([Unsupported CPU architecture $host_cpu]);;
svn commit: r1533348 - in /commons/proper/daemon/branches/1.0.x: RELEASE-NOTES.txt src/native/unix/native/java.c src/native/unix/native/location.c
Author: mturk Date: Fri Oct 18 07:40:05 2013 New Revision: 1533348 URL: http://svn.apache.org/r1533348 Log: Apply fix for DAEMON-281 Modified: commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt commons/proper/daemon/branches/1.0.x/src/native/unix/native/java.c commons/proper/daemon/branches/1.0.x/src/native/unix/native/location.c Modified: commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt?rev=1533348r1=1533347r2=1533348view=diff == --- commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt (original) +++ commons/proper/daemon/branches/1.0.x/RELEASE-NOTES.txt Fri Oct 18 07:40:05 2013 @@ -84,7 +84,7 @@ NEW FEATURES: BUG FIXES: -1.0.16: DAEMON-289, DAEMON-308 +1.0.16: DAEMON-281, DAEMON-289, DAEMON-308 1.0.15: DAEMON-288, DAEMON-291, DAEMON-292 Modified: commons/proper/daemon/branches/1.0.x/src/native/unix/native/java.c URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/unix/native/java.c?rev=1533348r1=1533347r2=1533348view=diff == --- commons/proper/daemon/branches/1.0.x/src/native/unix/native/java.c (original) +++ commons/proper/daemon/branches/1.0.x/src/native/unix/native/java.c Fri Oct 18 07:40:05 2013 @@ -203,6 +203,13 @@ bool java_init(arg_data *args, home_data return false; } } +if (stat(appf, sb)) { +if (replace(appf, 1024, $JAVA_HOME/../MacOS/libjli.dylib, +$JAVA_HOME, data-path) != 0) { +log_error(Cannot replace values in loader library); +return false; +} +} apph = dso_link(appf); if (apph == NULL) { log_error(Cannot load required shell library %s, appf); Modified: commons/proper/daemon/branches/1.0.x/src/native/unix/native/location.c URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/unix/native/location.c?rev=1533348r1=1533347r2=1533348view=diff == --- commons/proper/daemon/branches/1.0.x/src/native/unix/native/location.c (original) +++ commons/proper/daemon/branches/1.0.x/src/native/unix/native/location.c Fri Oct 18 07:40:05 2013 @@ -143,6 +143,7 @@ char *location_jvm_default[] = { */ char *location_jvm_configured[] = { #if defined(OS_DARWIN) +$JAVA_HOME/jre/lib/$VM_NAME/libjvm.dylib, $JAVA_HOME/../Libraries/lib$VM_NAME.dylib, #elif defined(OS_CYGWIN) $JAVA_HOME/jre/bin/$VM_NAME/jvm.dll, /* Sun JDK 1.3 */
svn commit: r1533373 - in /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl: GenericObjectPoolConfig.java GenericObjectPoolMXBean.java
Author: markt Date: Fri Oct 18 09:50:46 2013 New Revision: 1533373 URL: http://svn.apache.org/r1533373 Log: More Checkstyle inspired Javadoc fixes Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolMXBean.java Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java?rev=1533373r1=1533372r2=1533373view=diff == --- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java (original) +++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolConfig.java Fri Oct 18 09:50:46 2013 @@ -31,19 +31,20 @@ package org.apache.commons.pool2.impl; public class GenericObjectPoolConfig extends BaseObjectPoolConfig { /** - * The default maximum number of instances under management - * (idle or checked out). + * The default value for the {@code maxTotal} configuration attribute. + * @see GenericObjectPool#getMaxTotal() */ public static final int DEFAULT_MAX_TOTAL = 8; /** - * The default cap on the number of sleeping instances in the pool. + * The default value for the {@code maxIdle} configuration attribute. + * @see GenericObjectPool#getMaxIdle() */ public static final int DEFAULT_MAX_IDLE = 8; /** - * The default minimum number of sleeping instances in the pool before - * before the evictor thread (if active) spawns new objects. + * The default value for the {@code minIdle} configuration attribute. + * @see GenericObjectPool#getMinIdle() */ public static final int DEFAULT_MIN_IDLE = 0; @@ -54,28 +55,82 @@ public class GenericObjectPoolConfig ext private int minIdle = DEFAULT_MIN_IDLE; +/** + * Get the value for the {@code maxTotal} configuration attribute + * for pools created with this configuration instance. + * + * @return The current setting of {@code maxTotal} for this + * configuration instance + * + * @see GenericObjectPool#getMaxTotal() + */ public int getMaxTotal() { return maxTotal; } +/** + * Set the value for the {@code maxTotal} configuration attribute for + * pools created with this configuration instance. + * + * @param maxTotal The new setting of {@code maxTotal} + *for this configuration instance + * + * @see GenericObjectPool#setMaxTotal(int) + */ public void setMaxTotal(int maxTotal) { this.maxTotal = maxTotal; } +/** + * Get the value for the {@code maxIdle} configuration attribute + * for pools created with this configuration instance. + * + * @return The current setting of {@code maxIdle} for this + * configuration instance + * + * @see GenericObjectPool#getMaxIdle() + */ public int getMaxIdle() { return maxIdle; } +/** + * Set the value for the {@code maxIdle} configuration attribute for + * pools created with this configuration instance. + * + * @param maxIdle The new setting of {@code maxIdle} + *for this configuration instance + * + * @see GenericObjectPool#setMaxIdle(int) + */ public void setMaxIdle(int maxIdle) { this.maxIdle = maxIdle; } +/** + * Get the value for the {@code minIdle} configuration attribute + * for pools created with this configuration instance. + * + * @return The current setting of {@code minIdle} for this + * configuration instance + * + * @see GenericObjectPool#getMinIdle() + */ public int getMinIdle() { return minIdle; } +/** + * Set the value for the {@code minIdle} configuration attribute for + * pools created with this configuration instance. + * + * @param minIdle The new setting of {@code minIdle} + *for this configuration instance + * + * @see GenericObjectPool#setMinIdle(int) + */ public void setMinIdle(int minIdle) { this.minIdle = minIdle; } Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolMXBean.java URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolMXBean.java?rev=1533373r1=1533372r2=1533373view=diff == --- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericObjectPoolMXBean.java (original) +++
svn commit: r1533377 - in /commons/sandbox/monitoring/trunk: core/src/main/java/org/apache/commons/monitoring/configuration/ core/src/main/java/org/apache/commons/monitoring/counters/ core/src/main/ja
Author: rmannibucau Date: Fri Oct 18 10:04:46 2013 New Revision: 1533377 URL: http://svn.apache.org/r1533377 Log: pushin minimum data when using cube to try to reduce computation overhead Added: commons/sandbox/monitoring/trunk/cube/src/main/java/org/apache/commons/monitoring/cube/CubeCounter.java Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/BatchCounterDataStore.java commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/InMemoryCounterBaseStore.java commons/sandbox/monitoring/trunk/cube/src/main/java/org/apache/commons/monitoring/cube/CubeDataStore.java commons/sandbox/monitoring/trunk/cube/src/test/java/org/apache/commons/monitoring/cube/CubeDataStoreTest.java Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java?rev=1533377r1=1533376r2=1533377view=diff == --- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java (original) +++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/configuration/Configuration.java Fri Oct 18 10:04:46 2013 @@ -31,6 +31,7 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.Map; @@ -146,6 +147,10 @@ public final class Configuration { Class? current = loadedClass; while (current != null !current.isInterface() !Object.class.equals(current)) { for (final Field field : loadedClass.getDeclaredFields()) { +if (Modifier.isFinal(field.getModifiers())) { +continue; +} + final String value = PROPERTIES.getProperty(loadedClass.getName() + . + field.getName()); if (value != null) { final boolean acc = field.isAccessible(); Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java?rev=1533377r1=1533376r2=1533377view=diff == --- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java (original) +++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java Fri Oct 18 10:04:46 2013 @@ -66,6 +66,7 @@ public class DefaultCounter implements C @Override public void reset() { statistics.clear(); +concurrency.set(0); } @Override Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/BatchCounterDataStore.java URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/BatchCounterDataStore.java?rev=1533377r1=1533376r2=1533377view=diff == --- commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/BatchCounterDataStore.java (original) +++ commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/BatchCounterDataStore.java Fri Oct 18 10:04:46 2013 @@ -18,10 +18,14 @@ package org.apache.commons.monitoring.st import org.apache.commons.monitoring.Role; import org.apache.commons.monitoring.configuration.Configuration; +import org.apache.commons.monitoring.counters.Counter; +import org.apache.commons.monitoring.counters.DefaultCounter; import org.apache.commons.monitoring.repositories.Repository; import org.apache.commons.monitoring.util.DaemonThreadFactory; +import java.util.Collections; import java.util.Locale; +import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -45,10 +49,32 @@ public abstract class BatchCounterDataSt } @Override +public Counter getOrCreateCounter(final Counter.Key key) { +Counter counter = counters.get(key); +if (counter == null) { +
svn commit: r1533402 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
Author: britter Date: Fri Oct 18 11:45:26 2013 New Revision: 1533402 URL: http://svn.apache.org/r1533402 Log: Fix JavaDoc link Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java?rev=1533402r1=1533401r2=1533402view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Fri Oct 18 11:45:26 2013 @@ -280,7 +280,7 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(false)} method. + *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. *{@code false} will only match {@code public} fields. * @return the Field object * @throws IllegalArgumentException
svn commit: r1533406 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
Author: britter Date: Fri Oct 18 11:49:52 2013 New Revision: 1533406 URL: http://svn.apache.org/r1533406 Log: Add missing JavaDoc Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java?rev=1533406r1=1533405r2=1533406view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java Fri Oct 18 11:49:52 2013 @@ -399,10 +399,19 @@ public class FastDatePrinter implements return applyRulesToString(c); } +/** + * Creates a String representation of the given Calendar by applying the rules of this printer to it. + * @param c the Calender to apply the rules to. + * @return a String representation of the given Calendar. + */ private String applyRulesToString(final Calendar c) { return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString(); } +/** + * Creation method for ne calender instances. + * @return a new Calendar instance. + */ private GregorianCalendar newCalendar() { // hard code GregorianCalendar return new GregorianCalendar(mTimeZone, mLocale);
svn commit: r1533410 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java
Author: britter Date: Fri Oct 18 11:55:22 2013 New Revision: 1533410 URL: http://svn.apache.org/r1533410 Log: Make this a JavaDoc comment so that checkstyle is happy Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java?rev=1533410r1=1533409r2=1533410view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FormatCache.java Fri Oct 18 11:55:22 2013 @@ -125,7 +125,7 @@ abstract class FormatCacheF extends For return getInstance(pattern, timeZone, locale); } -/* +/** * pGets a date/time formatter instance using the specified style, * time zone and locale./p * @@ -143,7 +143,7 @@ abstract class FormatCacheF extends For return getDateTimeInstance(Integer.valueOf(dateStyle), Integer.valueOf(timeStyle), timeZone, locale); } -/* +/** * pGets a date formatter instance using the specified style, * time zone and locale./p * @@ -160,11 +160,10 @@ abstract class FormatCacheF extends For return getDateTimeInstance(Integer.valueOf(dateStyle), null, timeZone, locale); } -/* +/** * pGets a time formatter instance using the specified style, * time zone and locale./p * - * @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT * @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT * @param timeZone optional time zone, overrides time zone of * formatted date, null means use default Locale
svn commit: r1533411 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
Author: britter Date: Fri Oct 18 11:58:57 2013 New Revision: 1533411 URL: http://svn.apache.org/r1533411 Log: java.lang.reflect.AccessibleObject is only needed for JavaDoc. Remove it from the imports an link to is explicitly in JavaDoc. Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java?rev=1533411r1=1533410r2=1533411view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java Fri Oct 18 11:58:57 2013 @@ -16,7 +16,6 @@ */ package org.apache.commons.lang3.reflect; -import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; @@ -73,7 +72,8 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. *{@code false} will only match {@code public} fields. * @return the Field object * @throws IllegalArgumentException @@ -155,7 +155,8 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. *{@code false} will only match {@code public} fields. * @return the Field object * @throws IllegalArgumentException @@ -241,7 +242,8 @@ public class FieldUtils { * @param field *to read * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. * @return the field value * @throws IllegalArgumentException * if the field is {@code null} or not {@code static} @@ -280,7 +282,8 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. *{@code false} will only match {@code public} fields. * @return the Field object * @throws IllegalArgumentException @@ -324,7 +327,8 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. *{@code false} will only match {@code public} fields. * @return the Field object * @throws IllegalArgumentException @@ -365,7 +369,8 @@ public class FieldUtils { * @param target *the object to call on, may be {@code null} for {@code static} fields * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. * @return the field value * @throws IllegalArgumentException * if the field is {@code null} @@ -408,7 +413,8 @@ public class FieldUtils { * @param fieldName *the field name to obtain * @param forceAccess - *whether to break scope restrictions using the {@link AccessibleObject#setAccessible(boolean)} method. + *whether to break scope restrictions using the + *{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. *{@code false} will only
svn commit: r1533417 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java
Author: britter Date: Fri Oct 18 12:24:09 2013 New Revision: 1533417 URL: http://svn.apache.org/r1533417 Log: Add some JavaDoc to make CheckStyle happy Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java?rev=1533417r1=1533416r2=1533417view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeLiteral.java Fri Oct 18 12:24:09 2013 @@ -80,6 +80,9 @@ public abstract class TypeLiteralT imp private final String toString; +/** + * The default constructor. + */ protected TypeLiteral() { this.value = Validate.notNull(TypeUtils.getTypeArguments(getClass(), TypeLiteral.class).get(T),
svn commit: r1533434 - /commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
Author: tv Date: Fri Oct 18 13:01:29 2013 New Revision: 1533434 URL: http://svn.apache.org/r1533434 Log: Make sure that socket is closed Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=1533434r1=1533433r2=1533434view=diff == --- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original) +++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Fri Oct 18 13:01:29 2013 @@ -488,11 +488,13 @@ public class LateralTCPListenerK extend @Override public void run() { + ServerSocket serverSocket = null; + try { log.info( Listening on port + port ); -ServerSocket serverSocket = new ServerSocket( port ); +serverSocket = new ServerSocket( port ); serverSocket.setSoTimeout( acceptTimeOut ); ConnectionHandler handler; @@ -541,10 +543,24 @@ public class LateralTCPListenerK extend pooledExecutor.execute( handler ); } } -catch ( Exception e ) +catch ( IOException e ) { log.error( Exception caught in TCP listener, e ); } +finally +{ + if (serverSocket != null) + { + try + { + serverSocket.close(); + } + catch (IOException e) + { +log.error( Exception caught closing socket, e ); + } + } +} } } @@ -569,7 +585,7 @@ public class LateralTCPListenerK extend /** * Main processing method for the LateralTCPReceiverConnection object */ -@SuppressWarnings(unchecked) // Nee to cast from Object +@SuppressWarnings(unchecked) // Need to cast from Object public void run() { ObjectInputStream ois;
svn commit: r1533435 - /commons/proper/jcs/trunk/pom.xml
Author: tv Date: Fri Oct 18 13:02:03 2013 New Revision: 1533435 URL: http://svn.apache.org/r1533435 Log: Derive groupId from parent Modified: commons/proper/jcs/trunk/pom.xml Modified: commons/proper/jcs/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/pom.xml?rev=1533435r1=1533434r2=1533435view=diff == --- commons/proper/jcs/trunk/pom.xml (original) +++ commons/proper/jcs/trunk/pom.xml Fri Oct 18 13:02:03 2013 @@ -25,7 +25,6 @@ artifactIdcommons-parent/artifactId version32/version /parent - groupIdorg.apache.commons/groupId artifactIdcommons-jcs/artifactId packagingjar/packaging version2.0-SNAPSHOT/version
svn commit: r1533474 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Author: britter Date: Fri Oct 18 14:53:11 2013 New Revision: 1533474 URL: http://svn.apache.org/r1533474 Log: Correct JavaDoc for generic type parameter Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java?rev=1533474r1=1533473r2=1533474view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java Fri Oct 18 14:53:11 2013 @@ -55,7 +55,7 @@ public class TypeUtils { private Type[] upperBounds; private Type[] lowerBounds; - + public WildcardTypeBuilder withUpperBounds(Type... bounds) { this.upperBounds = bounds; return this; @@ -1547,7 +1547,7 @@ public class TypeUtils { /** * Wrap the specified {@link Type} in a {@link Typed} wrapper. * - * @param T inferred generic type + * @param T inferred generic type * @param type to wrap * @return TypedT */ @@ -1563,7 +1563,7 @@ public class TypeUtils { /** * Wrap the specified {@link Class} in a {@link Typed} wrapper. * - * @param T generic type + * @param T generic type * @param type to wrap * @return TypedT */
svn commit: r1533515 - in /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3: ArrayUtilsTest.java ObjectUtilsTest.java StringUtilsTest.java text/StrTokenizerTest.java
Author: sebb Date: Fri Oct 18 15:36:22 2013 New Revision: 1533515 URL: http://svn.apache.org/r1533515 Log: Suppress deprecated warnings for test code Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java?rev=1533515r1=1533514r2=1533515view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java Fri Oct 18 15:36:22 2013 @@ -39,6 +39,7 @@ import org.junit.Test; * * @version $Id$ */ +@SuppressWarnings(deprecation) // deliberate use of deprecated code public class ArrayUtilsTest { //--- @@ -1243,7 +1244,7 @@ public class ArrayUtilsTest { } -@Test + @Test public void testSubarrayFloat() { final float[] nullArray = null; final float[] array = { 10, 11, 12, 13, 14, 15 }; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java?rev=1533515r1=1533514r2=1533515view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/ObjectUtilsTest.java Fri Oct 18 15:36:22 2013 @@ -45,6 +45,7 @@ import org.junit.Test; * * @version $Id$ */ +@SuppressWarnings(deprecation) // deliberate use of deprecated code public class ObjectUtilsTest { private static final String FOO = foo; private static final String BAR = bar; Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java?rev=1533515r1=1533514r2=1533515view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java Fri Oct 18 15:36:22 2013 @@ -44,6 +44,7 @@ import org.junit.Test; * * @version $Id$ */ +@SuppressWarnings(deprecation) // deliberate use of deprecated code public class StringUtilsTest { static final String WHITESPACE; @@ -1304,7 +1305,6 @@ public class StringUtilsTest { } } -@SuppressWarnings(deprecation) // intentional test of deprecated method @Test public void testChomp() { Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java?rev=1533515r1=1533514r2=1533515view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrTokenizerTest.java Fri Oct 18 15:36:22 2013 @@ -18,7 +18,9 @@ package org.apache.commons.lang3.text; import org.junit.Test; + import static org.junit.Assert.*; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -31,6 +33,7 @@ import org.apache.commons.lang3.ObjectUt * Unit test for Tokenizer. * */ +@SuppressWarnings(deprecation) // deliberate use of deprecated code public class StrTokenizerTest { private static final String CSV_SIMPLE_FIXTURE = A,b,c;
svn commit: r1533527 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
Author: sebb Date: Fri Oct 18 16:03:17 2013 New Revision: 1533527 URL: http://svn.apache.org/r1533527 Log: Spelling Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java?rev=1533527r1=1533526r2=1533527view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java Fri Oct 18 16:03:17 2013 @@ -149,7 +149,7 @@ public class ObjectUtils { * @param object1 the first object, may be {@code null} * @param object2 the second object, may be {@code null} * @return {@code true} if the values of both objects are the same - * @deprecated this method has been replaces by {@code java.util.Objects.equals(Object, Object)} in Java 7 and will + * @deprecated this method has been replaced by {@code java.util.Objects.equals(Object, Object)} in Java 7 and will * be removed from future releases. */ public static boolean equals(final Object object1, final Object object2) { @@ -379,7 +379,7 @@ public class ObjectUtils { * @param obj the Object to {@code toString}, may be null * @return the passed in Object's toString, or {@code } if {@code null} input * @since 2.0 - * @deprecated this method has been replaces by {@code java.util.Objects.toString(Object)} in Java 7 and will be + * @deprecated this method has been replaced by {@code java.util.Objects.toString(Object)} in Java 7 and will be * removed in future releases. Note however that said method will return null for null references, while this * method returns and empty String. To preserve behavior use {@code java.util.Objects.toString(myObject, )} */ @@ -405,7 +405,7 @@ public class ObjectUtils { * @param nullStr the String to return if {@code null} input, may be null * @return the passed in Object's toString, or {@code nullStr} if {@code null} input * @since 2.0 - * @deprecated this method has been replaces by {@code java.util.Objects.toString(Object, String)} in Java 7 and + * @deprecated this method has been replaced by {@code java.util.Objects.toString(Object, String)} in Java 7 and * will be removed in future releases. */ public static String toString(final Object obj, final String nullStr) {
svn commit: r1533537 - in /commons/sandbox/monitoring/trunk: ./ collector/ collector/src/ collector/src/main/ collector/src/main/java/ collector/src/main/java/org/ collector/src/main/java/org/apache/
Author: rmannibucau Date: Fri Oct 18 16:23:12 2013 New Revision: 1533537 URL: http://svn.apache.org/r1533537 Log: adding base for a collector module, ATM counter data are not that consistent + tests need to be written Added: commons/sandbox/monitoring/trunk/collector/ commons/sandbox/monitoring/trunk/collector/pom.xml commons/sandbox/monitoring/trunk/collector/src/ commons/sandbox/monitoring/trunk/collector/src/main/ commons/sandbox/monitoring/trunk/collector/src/main/java/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/Event.java commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/RestCollector.java commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/store/ commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/store/CollectorCounter.java commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/store/CollectorCounterStore.java commons/sandbox/monitoring/trunk/collector/src/main/java/org/apache/commons/monitoring/collector/rest/store/CollectorDataStoreFactory.java commons/sandbox/monitoring/trunk/collector/src/main/resources/ commons/sandbox/monitoring/trunk/collector/src/test/ commons/sandbox/monitoring/trunk/collector/src/test/java/ Modified: commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/counters/DefaultCounter.java commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/repositories/DefaultRepository.java commons/sandbox/monitoring/trunk/core/src/main/java/org/apache/commons/monitoring/store/InMemoryGaugeDataStore.java commons/sandbox/monitoring/trunk/cube/src/main/java/org/apache/commons/monitoring/cube/CubeCounterDataStore.java commons/sandbox/monitoring/trunk/pom.xml Added: commons/sandbox/monitoring/trunk/collector/pom.xml URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/collector/pom.xml?rev=1533537view=auto == --- commons/sandbox/monitoring/trunk/collector/pom.xml (added) +++ commons/sandbox/monitoring/trunk/collector/pom.xml Fri Oct 18 16:23:12 2013 @@ -0,0 +1,56 @@ +?xml version=1.0 encoding=UTF-8? +!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the License); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an AS IS BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-- +project xmlns=http://maven.apache.org/POM/4.0.0; + xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd; + parent +artifactIdcommons-monitoring-parent/artifactId +groupIdorg.apache.commons.monitoring/groupId +version1.0-SNAPSHOT/version + /parent + + modelVersion4.0.0/modelVersion + + artifactIdcommons-monitoring-collector/artifactId + nameCommons Monitoring (Sandbox) :: Collector/name + + dependencies +dependency + groupIdorg.apache.geronimo.specs/groupId + artifactIdgeronimo-jaxrs_1.1_spec/artifactId + version1.0/version + scopeprovided/scope +/dependency + +dependency + groupIdorg.apache.commons.monitoring/groupId + artifactIdcommons-monitoring-core/artifactId +/dependency +dependency + groupIdcom.fasterxml.jackson.jaxrs/groupId + artifactIdjackson-jaxrs-json-provider/artifactId + version2.2.2/version +/dependency + + +dependency + groupIdjunit/groupId + artifactIdjunit/artifactId +/dependency + /dependencies +/project Added:
svn commit: r1533541 - in /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3: builder/ exception/ text/
Author: sebb Date: Fri Oct 18 16:33:52 2013 New Revision: 1533541 URL: http://svn.apache.org/r1533541 Log: Add dummy serialVersionUIDs to avoid IDE warnings Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ContextedRuntimeExceptionTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/CompositeFormatTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/StrBuilderAppendInsertTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java?rev=1533541r1=1533540r2=1533541view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringStyleTest.java Fri Oct 18 16:33:52 2013 @@ -28,6 +28,8 @@ import org.junit.Test; public class ToStringStyleTest { private static class ToStringStyleImpl extends ToStringStyle { + private static final long serialVersionUID = 1L; + } //--- Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ContextedRuntimeExceptionTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ContextedRuntimeExceptionTest.java?rev=1533541r1=1533540r2=1533541view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ContextedRuntimeExceptionTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ContextedRuntimeExceptionTest.java Fri Oct 18 16:33:52 2013 @@ -80,7 +80,8 @@ public class ContextedRuntimeExceptionTe @Test public void testContextedExceptionStringThrowableContext() { // Use an anonymous subclass to make sure users can provide custom implementations -exceptionContext = new ContextedRuntimeException(TEST_MESSAGE_2, new Exception(TEST_MESSAGE), new DefaultExceptionContext() {}); +exceptionContext = new ContextedRuntimeException(TEST_MESSAGE_2, new Exception(TEST_MESSAGE), + new DefaultExceptionContext() {private static final long serialVersionUID = 1L;}); final String message = exceptionContext.getMessage(); final String trace = ExceptionUtils.getStackTrace(exceptionContext); assertTrue(trace.indexOf(ContextedException)=0); Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java?rev=1533541r1=1533540r2=1533541view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java Fri Oct 18 16:33:52 2013 @@ -488,6 +488,8 @@ public class ExceptionUtilsTest { * of codeThrowable/code. */ private static class ExceptionWithCause extends Exception { + private static final long serialVersionUID = 1L; + private Throwable cause; public ExceptionWithCause(final String str, final Throwable cause) { @@ -516,7 +518,9 @@ public class ExceptionUtilsTest { * return value of codeThrowable/code. */ private static class ExceptionWithoutCause extends Exception { -@SuppressWarnings(unused) + private static final long serialVersionUID = 1L; + + @SuppressWarnings(unused) public void getTargetException() { } } @@ -524,6 +528,8 @@ public class ExceptionUtilsTest { // Temporary classes to allow the nested exception code to be removed // prior to a rewrite of this test class. private static class NestableException extends Exception { + private static final long serialVersionUID = 1L; + @SuppressWarnings(unused) public NestableException() { super(); } public NestableException(final Throwable t) { super(t); } Modified:
svn commit: r1533544 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
Author: sebb Date: Fri Oct 18 16:39:05 2013 New Revision: 1533544 URL: http://svn.apache.org/r1533544 Log: Don't override variable name Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java?rev=1533544r1=1533543r2=1533544view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java Fri Oct 18 16:39:05 2013 @@ -284,7 +284,7 @@ public class FastDateFormatTest { pool.submit(new Runnable() { @Override public void run() { -for(int i= 0; iNROUNDS; ++i) { +for(int j= 0; jNROUNDS; ++j) { try { final Date date= new Date(); final String formattedDate= formatter.format(date);
svn commit: r1533551 - in /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3: builder/ToStringBuilder.java event/EventListenerSupport.java text/StrSubstitutor.java text/StrTokenizer.jav
Author: sebb Date: Fri Oct 18 16:49:15 2013 New Revision: 1533551 URL: http://svn.apache.org/r1533551 Log: It's confusing to re-use field names locally Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java?rev=1533551r1=1533550r2=1533551view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java Fri Oct 18 16:49:15 2013 @@ -948,12 +948,12 @@ public class ToStringBuilder implements * /code method. Appends the class name followed by * {@link System#identityHashCode(java.lang.Object)}./p * - * @param object the codeObject/code whose class name and id to output + * @param srcObject the codeObject/code whose class name and id to output * @return this * @since 2.0 */ -public ToStringBuilder appendAsObjectToString(final Object object) { -ObjectUtils.identityToString(this.getStringBuffer(), object); +public ToStringBuilder appendAsObjectToString(final Object srcObject) { +ObjectUtils.identityToString(this.getStringBuffer(), srcObject); return this; } Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java?rev=1533551r1=1533550r2=1533551view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java Fri Oct 18 16:49:15 2013 @@ -247,13 +247,13 @@ public class EventListenerSupportL imp private void readObject(final ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { @SuppressWarnings(unchecked) // Will throw CCE here if not correct final -L[] listeners = (L[]) objectInputStream.readObject(); +L[] srcListeners = (L[]) objectInputStream.readObject(); -this.listeners = new CopyOnWriteArrayListL(listeners); +this.listeners = new CopyOnWriteArrayListL(srcListeners); @SuppressWarnings(unchecked) // Will throw CCE here if not correct final -ClassL listenerInterface = (ClassL) listeners.getClass().getComponentType(); +ClassL listenerInterface = (ClassL) srcListeners.getClass().getComponentType(); initializeTransientFields(listenerInterface, Thread.currentThread().getContextClassLoader()); } Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java?rev=1533551r1=1533550r2=1533551view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java Fri Oct 18 16:49:15 2013 @@ -738,10 +738,10 @@ public class StrSubstitutor { * represents a boolean flag as to whether any change occurred. */ private int substitute(final StrBuilder buf, final int offset, final int length, ListString priorVariables) { -final StrMatcher prefixMatcher = getVariablePrefixMatcher(); -final StrMatcher suffixMatcher = getVariableSuffixMatcher(); +final StrMatcher pfxMatcher = getVariablePrefixMatcher(); +final StrMatcher suffMatcher = getVariableSuffixMatcher(); final char escape = getEscapeChar(); -final StrMatcher valueDelimiterMatcher = getValueDelimiterMatcher(); +final StrMatcher valueDelimMatcher = getValueDelimiterMatcher(); final boolean substitutionInVariablesEnabled = isEnableSubstitutionInVariables(); final boolean top = priorVariables == null; @@ -751,7 +751,7 @@ public class StrSubstitutor { int bufEnd = offset + length; int pos = offset; while (pos bufEnd) { -final int
svn commit: r1533556 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
Author: sebb Date: Fri Oct 18 16:53:41 2013 New Revision: 1533556 URL: http://svn.apache.org/r1533556 Log: It's confusing to re-use field names locally Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java?rev=1533556r1=1533555r2=1533556view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Fri Oct 18 16:53:41 2013 @@ -159,15 +159,15 @@ public class DateUtilsTest { //--- @Test public void testIsSameDay_Date() { -Date date1 = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); -Date date2 = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); -assertTrue(DateUtils.isSameDay(date1, date2)); -date2 = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); -assertFalse(DateUtils.isSameDay(date1, date2)); -date1 = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); -assertTrue(DateUtils.isSameDay(date1, date2)); -date2 = new GregorianCalendar(2005, 6, 10, 13, 45).getTime(); -assertFalse(DateUtils.isSameDay(date1, date2)); +Date datea = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); +Date dateb = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); +assertTrue(DateUtils.isSameDay(datea, dateb)); +dateb = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); +assertFalse(DateUtils.isSameDay(datea, dateb)); +datea = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); +assertTrue(DateUtils.isSameDay(datea, dateb)); +dateb = new GregorianCalendar(2005, 6, 10, 13, 45).getTime(); +assertFalse(DateUtils.isSameDay(datea, dateb)); try { DateUtils.isSameDay((Date) null, (Date) null); fail(); @@ -177,15 +177,15 @@ public class DateUtilsTest { //--- @Test public void testIsSameDay_Cal() { -final GregorianCalendar cal1 = new GregorianCalendar(2004, 6, 9, 13, 45); -final GregorianCalendar cal2 = new GregorianCalendar(2004, 6, 9, 13, 45); -assertTrue(DateUtils.isSameDay(cal1, cal2)); -cal2.add(Calendar.DAY_OF_YEAR, 1); -assertFalse(DateUtils.isSameDay(cal1, cal2)); -cal1.add(Calendar.DAY_OF_YEAR, 1); -assertTrue(DateUtils.isSameDay(cal1, cal2)); -cal2.add(Calendar.YEAR, 1); -assertFalse(DateUtils.isSameDay(cal1, cal2)); +final GregorianCalendar cala = new GregorianCalendar(2004, 6, 9, 13, 45); +final GregorianCalendar calb = new GregorianCalendar(2004, 6, 9, 13, 45); +assertTrue(DateUtils.isSameDay(cala, calb)); +calb.add(Calendar.DAY_OF_YEAR, 1); +assertFalse(DateUtils.isSameDay(cala, calb)); +cala.add(Calendar.DAY_OF_YEAR, 1); +assertTrue(DateUtils.isSameDay(cala, calb)); +calb.add(Calendar.YEAR, 1); +assertFalse(DateUtils.isSameDay(cala, calb)); try { DateUtils.isSameDay((Calendar) null, (Calendar) null); fail(); @@ -195,15 +195,15 @@ public class DateUtilsTest { //--- @Test public void testIsSameInstant_Date() { -Date date1 = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); -Date date2 = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); -assertTrue(DateUtils.isSameInstant(date1, date2)); -date2 = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); -assertFalse(DateUtils.isSameInstant(date1, date2)); -date1 = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); -assertTrue(DateUtils.isSameInstant(date1, date2)); -date2 = new GregorianCalendar(2005, 6, 10, 13, 45).getTime(); -assertFalse(DateUtils.isSameInstant(date1, date2)); +Date datea = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); +Date dateb = new GregorianCalendar(2004, 6, 9, 13, 45).getTime(); +assertTrue(DateUtils.isSameInstant(datea, dateb)); +dateb = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); +assertFalse(DateUtils.isSameInstant(datea, dateb)); +datea = new GregorianCalendar(2004, 6, 10, 13, 45).getTime(); +assertTrue(DateUtils.isSameInstant(datea, dateb)); +dateb = new GregorianCalendar(2005, 6, 10, 13, 45).getTime(); +assertFalse(DateUtils.isSameInstant(datea, dateb)); try
svn commit: r1533566 - in /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3: builder/ToStringBuilderTest.java exception/ExceptionUtilsTest.java text/ExtendedMessageFormatTest.java
Author: sebb Date: Fri Oct 18 17:21:23 2013 New Revision: 1533566 URL: http://svn.apache.org/r1533566 Log: It's confusing to re-use field names locally Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java?rev=1533566r1=1533565r2=1533566view=diff == --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java Fri Oct 18 17:21:23 2013 @@ -156,8 +156,8 @@ public class ToStringBuilderTest { @Test public void testReflectionObjectArray() { Object[] array = new Object[] { null, base, new int[] { 3, 6 } }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{null,5,{3,6}}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{null,5,{3,6}}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -165,8 +165,8 @@ public class ToStringBuilderTest { @Test public void testReflectionLongArray() { long[] array = new long[] { 1, 2, -3, 4 }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -174,8 +174,8 @@ public class ToStringBuilderTest { @Test public void testReflectionIntArray() { int[] array = new int[] { 1, 2, -3, 4 }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -183,8 +183,8 @@ public class ToStringBuilderTest { @Test public void testReflectionShortArray() { short[] array = new short[] { 1, 2, -3, 4 }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -192,8 +192,8 @@ public class ToStringBuilderTest { @Test public void testReflectionyteArray() { byte[] array = new byte[] { 1, 2, -3, 4 }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{1,2,-3,4}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -201,8 +201,8 @@ public class ToStringBuilderTest { @Test public void testReflectionCharArray() { char[] array = new char[] { 'A', '2', '_', 'D' }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{A,2,_,D}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{A,2,_,D}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -210,8 +210,8 @@ public class ToStringBuilderTest { @Test public void testReflectionDoubleArray() { double[] array = new double[] { 1.0, 2.9876, -3.1, 4.3 }; -final String baseStr = this.toBaseString(array); -assertEquals(baseStr + [{1.0,2.9876,-3.1,4.3}], ToStringBuilder.reflectionToString(array)); +final String baseString = this.toBaseString(array); +assertEquals(baseString + [{1.0,2.9876,-3.1,4.3}], ToStringBuilder.reflectionToString(array)); array = null; assertReflectionArray(null, array); } @@ -219,8 +219,8 @@ public class
svn commit: r1533570 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
Author: sebb Date: Fri Oct 18 17:40:28 2013 New Revision: 1533570 URL: http://svn.apache.org/r1533570 Log: It's confusing to re-use field names locally Document that the parameter is unused Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java?rev=1533570r1=1533569r2=1533570view=diff == --- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java (original) +++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java Fri Oct 18 17:40:28 2013 @@ -299,8 +299,8 @@ public class EventListenerSupportL imp * Propagates the method call to all registered listeners in place of * the proxy listener object. * - * @param proxy the proxy object representing a listener on which the - *invocation was called. + * @param unusedProxy the proxy object representing a listener on which the + *invocation was called; not used * @param method the listener method that will be called on all of the *listeners. * @param args event arguments to propagate to the listeners. @@ -308,7 +308,7 @@ public class EventListenerSupportL imp * @throws Throwable if an error occurs */ @Override -public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { +public Object invoke(final Object unusedProxy, final Method method, final Object[] args) throws Throwable { for (final L listener : listeners) { method.invoke(listener, args); }
svn commit: r1533638 - in /commons/proper/math/trunk/src: changes/ main/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/linear/
Author: tn Date: Fri Oct 18 21:19:18 2013 New Revision: 1533638 URL: http://svn.apache.org/r1533638 Log: [MATH-1004] Added new methods to compute the inverse of a matrix to DiagonalMatrix and MatrixUtils. Modified: commons/proper/math/trunk/src/changes/changes.xml commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/DiagonalMatrix.java commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/DiagonalMatrixTest.java commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/MatrixUtilsTest.java Modified: commons/proper/math/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/changes/changes.xml?rev=1533638r1=1533637r2=1533638view=diff == --- commons/proper/math/trunk/src/changes/changes.xml (original) +++ commons/proper/math/trunk/src/changes/changes.xml Fri Oct 18 21:19:18 2013 @@ -51,6 +51,10 @@ If the output is not quite correct, chec /properties body release version=x.y date=TBD description=TBD + action dev=tn type=add issue=MATH-1004 due-to=Ajo Fod +Added new methods to compute the inverse of a matrix to DiagonalMatrix +and MatrixUtils. + /action action dev=tn type=fix issue=MATH-1029 The BigFraction constructor will throw a FractionConversionException also in case negative values are provided which exceed the allowed range Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/DiagonalMatrix.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/DiagonalMatrix.java?rev=1533638r1=1533637r2=1533638view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/DiagonalMatrix.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/DiagonalMatrix.java Fri Oct 18 21:19:18 2013 @@ -319,4 +319,53 @@ public class DiagonalMatrix extends Abst } } +/** + * Computes the inverse of this diagonal matrix. + * p + * Note: this method will use a singularity threshold of 0, + * use {@link #inverse(double)} if a different threshold is needed. + * + * @return the inverse of {@code m} + * @throws SingularMatrixException if the matrix is singular + * @since 3.3 + */ +public DiagonalMatrix inverse() throws SingularMatrixException { +return inverse(0); +} + +/** + * Computes the inverse of this diagonal matrix. + * + * @param threshold Singularity threshold. + * @return the inverse of {@code m} + * @throws SingularMatrixException if the matrix is singular + * @since 3.3 + */ +public DiagonalMatrix inverse(double threshold) throws SingularMatrixException { +if (isSingular(threshold)) { +throw new SingularMatrixException(); +} + +final double[] result = new double[data.length]; +for (int i = 0; i data.length; i++) { +result[i] = 1.0 / data[i]; +} +return new DiagonalMatrix(result, false); +} + +/** Returns whether this diagonal matrix is singular, i.e. any diagonal entry + * is equal to {@code 0} within the given threshold. + * + * @param threshold Singularity threshold. + * @return {@code true} if the matrix is singular, {@code false} otherwise + * @since 3.3 + */ +public boolean isSingular(double threshold) { +for (int i = 0; i data.length; i++) { +if (Precision.equals(data[i], 0.0, threshold)) { +return true; +} +} +return false; +} } Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java?rev=1533638r1=1533637r2=1533638view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/MatrixUtils.java Fri Oct 18 21:19:18 2013 @@ -36,6 +36,7 @@ import org.apache.commons.math3.fraction import org.apache.commons.math3.fraction.Fraction; import org.apache.commons.math3.util.FastMath; import org.apache.commons.math3.util.MathArrays; +import org.apache.commons.math3.util.MathUtils; import org.apache.commons.math3.util.Precision; /** @@ -1063,4 +1064,57 @@ public class MatrixUtils { return result; } + +/** + * Computes the inverse of the given matrix. + * p + * By default,
svn commit: r1533642 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java
Author: tn Date: Fri Oct 18 21:33:49 2013 New Revision: 1533642 URL: http://svn.apache.org/r1533642 Log: Remove unused import. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java?rev=1533642r1=1533641r2=1533642view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java Fri Oct 18 21:33:49 2013 @@ -16,7 +16,6 @@ */ package org.apache.commons.math3.stat.descriptive; -import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.exception.NotPositiveException; import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.NumberIsTooLargeException;
svn commit: r1533643 - in /commons/proper/math/trunk/src: changes/changes.xml main/java/org/apache/commons/math3/util/ArithmeticUtils.java test/java/org/apache/commons/math3/util/ArithmeticUtilsTest.j
Author: tn Date: Fri Oct 18 21:40:42 2013 New Revision: 1533643 URL: http://svn.apache.org/r1533643 Log: [MATH-1035] Simplified and improved performance of ArithmeticUtils.addAndCheck(long, long), thanks to derphead Modified: commons/proper/math/trunk/src/changes/changes.xml commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ArithmeticUtilsTest.java Modified: commons/proper/math/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/changes/changes.xml?rev=1533643r1=1533642r2=1533643view=diff == --- commons/proper/math/trunk/src/changes/changes.xml (original) +++ commons/proper/math/trunk/src/changes/changes.xml Fri Oct 18 21:40:42 2013 @@ -51,6 +51,9 @@ If the output is not quite correct, chec /properties body release version=x.y date=TBD description=TBD + action dev=tn type=fix issue=MATH-1035 due-to=derphead +Simplified and improved performance of ArithmeticUtils#addAndCheck(long, long). + /action action dev=tn type=add issue=MATH-1004 due-to=Ajo Fod Added new methods to compute the inverse of a matrix to DiagonalMatrix and MatrixUtils. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java?rev=1533643r1=1533642r2=1533643view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java Fri Oct 18 21:40:42 2013 @@ -62,12 +62,11 @@ public final class ArithmeticUtils { * @param a an addend * @param b an addend * @return the sum {@code a+b} - * @throws MathArithmeticException if the result can not be represented as an - * long + * @throws MathArithmeticException if the result can not be represented as an long * @since 1.2 */ public static long addAndCheck(long a, long b) throws MathArithmeticException { -return ArithmeticUtils.addAndCheck(a, b, LocalizedFormats.OVERFLOW_IN_ADDITION); +return addAndCheck(a, b, LocalizedFormats.OVERFLOW_IN_ADDITION); } /** @@ -247,9 +246,7 @@ public final class ArithmeticUtils { * a non-negative {@code int} value. * @since 1.1 */ -public static int gcd(int p, - int q) -throws MathArithmeticException { +public static int gcd(int p, int q) throws MathArithmeticException { int a = p; int b = q; if (a == 0 || @@ -326,8 +323,7 @@ public final class ArithmeticUtils { * @param b Positive number. * @return the greatest common divisor. */ -private static int gcdPositive(int a, - int b) { +private static int gcdPositive(int a, int b) { if (a == 0) { return b; } @@ -842,38 +838,11 @@ public final class ArithmeticUtils { * @since 1.2 */ private static long addAndCheck(long a, long b, Localizable pattern) throws MathArithmeticException { -long ret; -if (a b) { -// use symmetry to reduce boundary cases -ret = addAndCheck(b, a, pattern); -} else { -// assert a = b - -if (a 0) { -if (b 0) { -// check for negative overflow -if (Long.MIN_VALUE - b = a) { -ret = a + b; -} else { -throw new MathArithmeticException(pattern, a, b); -} -} else { -// opposite sign addition is always safe -ret = a + b; -} -} else { -// assert a = 0 -// assert b = 0 - -// check for positive overflow -if (a = Long.MAX_VALUE - b) { -ret = a + b; -} else { -throw new MathArithmeticException(pattern, a, b); -} -} -} -return ret; + final long result = a + b; + if (!((a ^ b) 0 | (a ^ result) = 0)) { + throw new MathArithmeticException(pattern, a, b); + } + return result; } /** Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/ArithmeticUtilsTest.java URL:
svn commit: r1533646 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java
Author: tn Date: Fri Oct 18 21:58:39 2013 New Revision: 1533646 URL: http://svn.apache.org/r1533646 Log: Add javadoc for generic parameter types. Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java?rev=1533646r1=1533645r2=1533646view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java Fri Oct 18 21:58:39 2013 @@ -143,6 +143,8 @@ public class PairK, V { * Convenience factory method that calls the * {@link #Pair(Object, Object) constructor}. * + * @param K the key type + * @param V the value type * @param k First element of the pair. * @param v Second element of the pair. * @return a new {@code Pair} containing {@code k} and {@code v}.
svn commit: r1533650 - /commons/proper/pool/trunk/src/site/xdoc/index.xml
Author: psteitz Date: Fri Oct 18 22:14:12 2013 New Revision: 1533650 URL: http://svn.apache.org/r1533650 Log: More 2.0 content updates. Modified: commons/proper/pool/trunk/src/site/xdoc/index.xml Modified: commons/proper/pool/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/site/xdoc/index.xml?rev=1533650r1=1533649r2=1533650view=diff == --- commons/proper/pool/trunk/src/site/xdoc/index.xml (original) +++ commons/proper/pool/trunk/src/site/xdoc/index.xml Fri Oct 18 22:14:12 2013 @@ -25,19 +25,9 @@ body section name=The Pool Component p - Pool provides an Object-pooling API, with three major aspects: - ol - li -A generic object pool interface that clients and implementors can use to provide easily -interchangeable pooling implementations. - /li - li -A toolkit for creating modular object pools. - /li - li -Several general purpose pool implementations. - /li - /ol + Pool provides an Object-pooling API and some pool implementations. Version 2 of Commons + pool is a complete rewrite. In addition to performance and scalability improvements, + version 2 implementations include robust instance tracking and pool monitoring. /p /section @@ -54,45 +44,10 @@ package defines a handful of pooling interfaces and some base classes that may be useful when creating new pool implementations. /p -subsection name=ObjectPool - p - a href=./apidocs/org/apache/commons/pool2/ObjectPool.htmlcodeObjectPool/code/a - defines a trivially simple pooling interface: - /p -source -public interface ObjectPoollt;Tgt; { -T borrowObject(); -void returnObject(T borrowed); -} -/source - p -Some client classes won't integrate with iPool/i any more than this. -Clients written to this interface can use arbitrary codeObjectPool/code -implementations interchangeably. - /p - p - a href=./apidocs/org/apache/commons/pool2/BaseObjectPool.htmlcodeBaseObjectPool/code/a - provides an abstract base implementation of codeObjectPool/code. Clients are - encouraged but not required to extend codeBaseObjectPool/code for new - codeObjectPool/code implementations. - /p - p - a href=./apidocs/org/apache/commons/pool2/KeyedObjectPool.htmlcodeKeyedObjectPool/code/a - defines a similar interface for pools composed of heterogeneous objects: - /p -source -public interface KeyedObjectPoollt;K,Vgt; { -V borrowObject(K key); -void returnObject(K key, V borrowed); -} -/source -/subsection subsection name=PooledObjectFactory p - The iPool/i package makes it possible separate the way in which instances - are pooled from the way in which instances are created and destroyed. a href=./apidocs/org/apache/commons/pool2/PooledObjectFactory.htmlcodePooledObjectFactory/code/a - supports this by providing a generic interface for the lifecycle of a pooled object: + provides a generic interface for managing the lifecycle of a pooled object: /p source public interface PooledObjectFactorylt;Tgt; { @@ -102,18 +57,33 @@ public interface PooledObjectFactorylt; boolean validateObject(PooledObjectlt;Tgt; obj); void destroyObject(PooledObjectlt;Tgt; obj); } -/source +/source p - codeObjectPool/code implementations may be written to accept arbitrary - codePooledObjectFactory/codes. - This makes is possible for clients to select pooling-behavior distinct - from the kinds of objects that are pooled. - /p - p - a href=./apidocs/org/apache/commons/pool2/BasePooledObjectFactory.htmlcodeBasePooledObjectFactory/code/a - provides an abstract base implementation of codePooledObjectFactory/code that - makes implementations a snap. - /p +Users of 1.x versions of Commons pool will notice that while the codePoolableObjectFactory/codes used by +1.x pools create and manage pooled objects directly, version 2 codePooledObjectFactory/codes create and +manage +a href=./apidocs/org/apache/commons/pool2/PooledObjectcodePooledObject/code/as. These object wrappers +maintain object pooling state, enabling codePooledObjectFactory/code methods to have access to data such +as instance creation time or time or time of last use. A +a
svn commit: r1533656 - in /commons/proper/scxml/trunk: ./ src/main/java/org/apache/commons/scxml2/env/jexl/ src/test/java/org/apache/commons/scxml2/ src/test/java/org/apache/commons/scxml2/env/jexl/
Author: woonsan Date: Fri Oct 18 22:40:50 2013 New Revision: 1533656 URL: http://svn.apache.org/r1533656 Log: SCXML-114: Upgrading JEXL to 2.1.1 - Applied Henri Biestro's patch with some small additional work (e.g, J6 generics, renaming, javadocs, unit test) - Many thanks to Henri Biestro! Added: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlBuiltin.java Modified: commons/proper/scxml/trunk/pom.xml commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlContext.java commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlEvaluator.java commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jexl/JexlContextTest.java commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jexl/JexlEvaluatorTest.java Modified: commons/proper/scxml/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/pom.xml?rev=1533656r1=1533655r2=1533656view=diff == --- commons/proper/scxml/trunk/pom.xml (original) +++ commons/proper/scxml/trunk/pom.xml Fri Oct 18 22:40:50 2013 @@ -156,9 +156,9 @@ optionaltrue/optional /dependency dependency - groupIdcommons-jexl/groupId + groupIdorg.apache.commons/groupId artifactIdcommons-jexl/artifactId - version1.1/version + version2.1.1/version optionaltrue/optional /dependency dependency Added: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlBuiltin.java URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlBuiltin.java?rev=1533656view=auto == --- commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlBuiltin.java (added) +++ commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml2/env/jexl/JexlBuiltin.java Fri Oct 18 22:40:50 2013 @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.scxml2.env.jexl; + +import java.util.Map; +import java.util.Set; + +import org.apache.commons.scxml2.Builtin; +import org.apache.commons.scxml2.model.TransitionTarget; + +/** + * Global JEXL namespace functor, implements Data() and In() operators. + * Cooperates with JexlContext. + */ +public final class JexlBuiltin { +/** + * The context currently in use for evaluation. + */ +private final JexlContext context; + +/** + * Creates a new instance, wraps the context. + * @param ctxt the context in use + */ +public JexlBuiltin(final JexlContext ctxt) { +context = ctxt; +} + +/** + * Gets the ALL_NAMESPACES map from context. + * @return the ALL_NAMESPACES map + */ +private MapString, String getNamespaces() { +return (MapString, String) context.get(_ALL_NAMESPACES); +} + +/** + * Gets the ALL_STATES set from context. + * @return the ALL_STATES set + */ +private SetTransitionTarget getAllStates() { +return (SetTransitionTarget) context.get(_ALL_STATES); +} + +/** + * Implements the Data() predicate for SCXML documents ( see Builtin#data ). + * @param data the context node + * @param path the XPath expression + * @return the first node matching the path + */ +public Object Data(final Object data, final String path) { +// first call maps delegates to dataNode(), subsequent ones to data() +if (context.isEvaluatingLocation()) { +context.setEvaluatingLocation(false); +return Builtin.dataNode(getNamespaces(), data, path); +} else { +return Builtin.data(getNamespaces(), data, path); +} +} + +/** + * Implements the In() predicate for SCXML documents ( see Builtin#isMember ) + * @param state The State ID to compare with + * @return Whether this State belongs to this Set + */ +public boolean In(final String state) { +