hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bowen <dbo...@yahoo-inc.com>
Subject Re: svn commit: r397269 - in /lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi: AbstractMetricsContext.java MetricsRecordImpl.java
Date Mon, 01 May 2006 14:05:17 GMT

Doug,

Thanks for making those fixes.  I will take care to test properly with 
1.4 in future.

- David

cutting@apache.org wrote:
> Author: cutting
> Date: Wed Apr 26 11:43:20 2006
> New Revision: 397269
>
> URL: http://svn.apache.org/viewcvs?rev=397269&view=rev
> Log:
> Remove some Java 1.5 dependencies from the new metrics code.
>
> Modified:
>     lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java
>     lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java
>
> Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java
> URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java?rev=397269&r1=397268&r2=397269&view=diff
> ==============================================================================
> --- lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java
(original)
> +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/AbstractMetricsContext.java
Wed Apr 26 11:43:20 2006
> @@ -339,16 +339,16 @@
>       */
>      private Number sum(Number a, Number b) {
>          if (a instanceof Integer) {
> -            return Integer.valueOf(a.intValue() + b.intValue());
> +            return new Integer(a.intValue() + b.intValue());
>          }
>          else if (a instanceof Float) {
> -            return Float.valueOf(a.floatValue() + b.floatValue());
> +            return new Float(a.floatValue() + b.floatValue());
>          }
>          else if (a instanceof Short) {
> -            return Short.valueOf((short)(a.shortValue() + b.shortValue()));
> +            return new Short((short)(a.shortValue() + b.shortValue()));
>          }
>          else if (a instanceof Byte) {
> -            return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
> +            return new Byte((byte)(a.byteValue() + b.byteValue()));
>          }
>          else {
>              // should never happen
>
> Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java
> URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java?rev=397269&r1=397268&r2=397269&view=diff
> ==============================================================================
> --- lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java
(original)
> +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java
Wed Apr 26 11:43:20 2006
> @@ -73,7 +73,7 @@
>       * @throws MetricsException if the tagName conflicts with the configuration
>       */
>      public void setTag(String tagName, int tagValue) {
> -        tagTable.put(tagName, Integer.valueOf(tagValue));
> +        tagTable.put(tagName, new Integer(tagValue));
>      }
>      
>      /**
> @@ -84,7 +84,7 @@
>       * @throws MetricsException if the tagName conflicts with the configuration
>       */
>      public void setTag(String tagName, short tagValue) {
> -        tagTable.put(tagName, Short.valueOf(tagValue));
> +        tagTable.put(tagName, new Short(tagValue));
>      }
>      
>      /**
> @@ -95,7 +95,7 @@
>       * @throws MetricsException if the tagName conflicts with the configuration
>       */
>      public void setTag(String tagName, byte tagValue) {
> -        tagTable.put(tagName, Byte.valueOf(tagValue));
> +        tagTable.put(tagName, new Byte(tagValue));
>      }
>      
>      /**
> @@ -107,7 +107,7 @@
>       * conflicts with the configuration
>       */
>      public void setMetric(String metricName, int metricValue) {
> -        setAbsolute(metricName, Integer.valueOf(metricValue));
> +        setAbsolute(metricName, new Integer(metricValue));
>      }
>      
>      /**
> @@ -119,7 +119,7 @@
>       * conflicts with the configuration
>       */
>      public void setMetric(String metricName, short metricValue) {
> -        setAbsolute(metricName, Short.valueOf(metricValue));
> +        setAbsolute(metricName, new Short(metricValue));
>      }
>      
>      /**
> @@ -131,7 +131,7 @@
>       * conflicts with the configuration
>       */
>      public void setMetric(String metricName, byte metricValue) {
> -        setAbsolute(metricName, Byte.valueOf(metricValue));
> +        setAbsolute(metricName, new Byte(metricValue));
>      }
>      
>      /**
> @@ -143,7 +143,7 @@
>       * conflicts with the configuration
>       */
>      public void setMetric(String metricName, float metricValue) {
> -        setAbsolute(metricName, Float.valueOf(metricValue));
> +        setAbsolute(metricName, new Float(metricValue));
>      }
>      
>      /**
> @@ -155,7 +155,7 @@
>       * conflicts with the configuration
>       */
>      public void incrMetric(String metricName, int metricValue) {
> -        setIncrement(metricName, Integer.valueOf(metricValue));
> +        setIncrement(metricName, new Integer(metricValue));
>      }
>      
>      /**
> @@ -167,7 +167,7 @@
>       * conflicts with the configuration
>       */
>      public void incrMetric(String metricName, short metricValue) {
> -        setIncrement(metricName, Short.valueOf(metricValue));
> +        setIncrement(metricName, new Short(metricValue));
>      }
>      
>      /**
> @@ -179,7 +179,7 @@
>       * conflicts with the configuration
>       */
>      public void incrMetric(String metricName, byte metricValue) {
> -        setIncrement(metricName, Byte.valueOf(metricValue));
> +        setIncrement(metricName, new Byte(metricValue));
>      }
>      
>      /**
> @@ -191,7 +191,7 @@
>       * conflicts with the configuration
>       */
>      public void incrMetric(String metricName, float metricValue) {
> -        setIncrement(metricName, Float.valueOf(metricValue));
> +        setIncrement(metricName, new Float(metricValue));
>      }
>      
>      private void setAbsolute(String metricName, Number metricValue) {
>
>
>   


Mime
View raw message