private static Element execute(SourceRange sourceRange, Property a,
			Property b) {

		assert (a != null);
		assert (b != null);

		Element result = null;

		if ((a instanceof LongProperty) && (b instanceof LongProperty)) {

			long l1 = ((Long) a.getValue()).longValue();
			long l2 = ((Long) b.getValue()).longValue();

			result = LongProperty.getInstance(l1 + l2);

		} else if ((a instanceof NumberProperty)
				&& (b instanceof NumberProperty)) {

			double d1 = ((NumberProperty) a).doubleValue();
			double d2 = ((NumberProperty) b).doubleValue();

			result = DoubleProperty.getInstance(d1 + d2);

		} else if ((a instanceof StringProperty)
				&& (b instanceof StringProperty)) {

			String s1 = (String) a.getValue();
			String s2 = (String) b.getValue();

			result = StringProperty.getInstance(s1 + s2);

		} else {
			throw new EvaluationException(MessageUtils
					.format(MSG_MISMATCHED_ARGS_ADD), sourceRange);
		}

		return result;
	}
private static Element execute ( SourceRange sourceRange , Property a , Property b ) { assert ( a != null ) ; assert ( b != null ) ; Element result = null ; if ( ( a instanceof LongProperty ) && ( b instanceof LongProperty ) ) { long l1 = ( ( Long ) a . getValue ( ) ) . longValue ( ) ; long l2 = ( ( Long ) b . getValue ( ) ) . longValue ( ) ; result = LongProperty . getInstance ( l1 + l2 ) ; } else if ( ( a instanceof NumberProperty ) && ( b instanceof NumberProperty ) ) { double d1 = ( ( NumberProperty ) a ) . doubleValue ( ) ; double d2 = ( ( NumberProperty ) b ) . doubleValue ( ) ; result = DoubleProperty . getInstance ( d1 + d2 ) ; } else if ( ( a instanceof StringProperty ) && ( b instanceof StringProperty ) ) { String s1 = ( String ) a . getValue ( ) ; String s2 = ( String ) b . getValue ( ) ; result = StringProperty . getInstance ( s1 + s2 ) ; } else { throw new EvaluationException ( MessageUtils . format ( MSG_MISMATCHED_ARGS_ADD ) , sourceRange ) ; } return result ; }
Do the actual addition.