[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo/test ...
Jason Thomas Greene
jgreene at jboss.com
Tue Jul 17 23:01:49 EDT 2007
User: jgreene
Date: 07/07/17 23:01:49
Modified: tests/functional/org/jboss/cache/pojo/test EnumPlanet.java
Log:
Remove 'final' field replication support, which was broken anyway
Fix enum test
Revision Changes Path
1.2 +4 -32 JBossCache/tests/functional/org/jboss/cache/pojo/test/EnumPlanet.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EnumPlanet.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/pojo/test/EnumPlanet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- EnumPlanet.java 13 Jan 2007 15:55:01 -0000 1.1
+++ EnumPlanet.java 18 Jul 2007 03:01:49 -0000 1.2
@@ -25,14 +25,8 @@
/**
* Test class for PojoCache Enum.
*
- * @version $Revision: 1.1 $
- * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
- * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
- * so a annoc Ant build target is needed to pre-compile it.</p>
- * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
+ * @version $Revision: 1.2 $
*/
-// We are using JDK1.5 annotation.
- at org.jboss.cache.pojo.annotation.Replicable
public enum EnumPlanet
{
MERCURY(3.303e+23, 2.4397e6),
@@ -44,13 +38,10 @@
URANUS(8.686e+25, 2.5559e7),
NEPTUNE(1.024e+26, 2.4746e7);
- private double mass; // in kilograms
- private double radius; // in meters
+ private final double mass; // in kilograms
+ private final double radius; // in meters
- // Need this for PojoCache. Can be private as well!
- EnumPlanet() {;}
-
- EnumPlanet(double mass, double radius)
+ private EnumPlanet(double mass, double radius)
{
this.mass = mass;
this.radius = radius;
@@ -66,16 +57,6 @@
return radius;
}
- public void setMass(double mass)
- {
- this.mass = mass;
- }
-
- public void setRadius(double radius)
- {
- this.radius = radius;
- }
-
// universal gravitational constant (m3 kg-1 s-2)
public static final double G = 6.67300E-11;
@@ -88,13 +69,4 @@
{
return otherMass * surfaceGravity();
}
-
- public static void main(String[] args)
- {
- double earthWeight = Double.parseDouble(args[0]);
- double mass = earthWeight / EARTH.surfaceGravity();
- for (EnumPlanet p : EnumPlanet.values())
- System.out.printf("Weight on %s is %f%n",
- p, p.surfaceWeight(mass));
- }
}
More information about the jboss-cvs-commits
mailing list