Hi James:

The class hierarchy for these two classes are:

ArithmeticExpression -> AddExpression -> DecimalAddExpression
                                    -> SubtractExpression -> 
DecimalSubtractExpression.

I don't think I can create a common parent class that contains the 
logic, since the logic is specific to DecimalAdd and DecimalSubstract 
and not applicable for general AddExpression and SubtractExpression.

On 03/12/2013 12:15 PM, James Taylor wrote:
>
> In 
> src/main/java/com/salesforce/phoenix/expression/DecimalAddExpression.java:
>
> >              }
> >          }
> >          ptr.set(PDataType.DECIMAL.toBytes(result));
> >          return true;
> >      }
> >
> > +    private int getPrecision(int lp, int rp, int ls, int rs) {
>
> Make these static, create an intermediate class for AddExpression and 
> SubtractExpression where we can share this logic.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/forcedotcom/phoenix/pull/90/files#r3341615>.
>