mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-08 11:05:09 +00:00
Attempt to get around a JDK Linux bug
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9114dac200
commit
e356710ae4
@ -61,19 +61,24 @@
|
||||
* Operator enumeration.
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id: OperationEnum.java,v 1.2 2003/05/22 22:00:06 scolebourne Exp $
|
||||
* @version $Id: OperationEnum.java,v 1.3 2003/08/02 18:38:36 scolebourne Exp $
|
||||
*/
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user