commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/enum OperationEnum.java
Date Sat, 02 Aug 2003 18:38:36 GMT
scolebourne    2003/08/02 11:38:36

  Modified:    lang/src/test/org/apache/commons/lang/enum
                        OperationEnum.java
  Log:
  Attempt to get around a JDK Linux bug
  
  Revision  Changes    Path
  1.3       +16 -11    jakarta-commons/lang/src/test/org/apache/commons/lang/enum/OperationEnum.java
  
  Index: OperationEnum.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/enum/OperationEnum.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OperationEnum.java	22 May 2003 22:00:06 -0000	1.2
  +++ OperationEnum.java	2 Aug 2003 18:38:36 -0000	1.3
  @@ -64,16 +64,21 @@
    * @version $Id$
    */
   public abstract class OperationEnum extends Enum {
  -    public static final OperationEnum PLUS = new OperationEnum("Plus") {
  -        public int eval(int a, int b) {
  -            return (a + b);
  -        }
  -    };
  -    public static final OperationEnum MINUS = new OperationEnum("Minus") {
  -        public int eval(int a, int b) {
  -            return (a - b);
  -        }
  -    };
  +    public static final OperationEnum PLUS;
  +    public static final OperationEnum MINUS;
  +    static {
  +        // Get around JDK Linux bug
  +        PLUS = new OperationEnum("Plus") {
  +            public int eval(int a, int b) {
  +                return (a + b);
  +            }
  +        };
  +        MINUS = new OperationEnum("Minus") {
  +            public int eval(int a, int b) {
  +                return (a - b);
  +            }
  +        };
  +    }
   
       private OperationEnum(String name) {
           super(name);
  
  
  

Mime
View raw message