Buggy code:
case JJTAND : return and ( getExpression ( left ( node ) ) , getExpression ( right ( node ) ) ) ; case JJTEQUALS : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . equal ( val1 , val2 ) ; case JJTNOTEQUALS : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . notEqual ( val1 , val2 ) ; case JJTLESSTHAN : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . lessThan ( val1 , val2 ) ; case JJTLESSOREQUAL : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . lessThanEqual ( val1 , val2 ) ; case JJTGREATERTHAN : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . greaterThan ( val1 , val2 ) ; case JJTGREATEROREQUAL : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , null ) ; return factory . greaterThanEqual ( val1 , val2 ) ; case JJTADD : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , TYPE_NUMBER ) ; return factory . add ( val1 , val2 ) ; case JJTSUBTRACT : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , TYPE_NUMBER ) ; return factory . subtract ( val1 , val2 ) ; case JJTMULTIPLY : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , TYPE_NUMBER ) ; return factory . multiply ( val1 , val2 ) ; case JJTDIVIDE : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitTypes ( val1 , val2 , TYPE_NUMBER ) ; return factory . divide ( val1 , val2 ) ; case JJTBETWEEN : val1 = getValue ( child ( node , 0 , 3 ) ) ; val2 = getValue ( child ( node , 1 , 3 ) ) ; val3 = getValue ( child ( node , 2 , 3 ) ) ; setImplicitTypes ( val1 , val2 , null ) ; setImplicitTypes ( val1 , val3 , null ) ; return evalNot ( not , and ( factory . greaterThanEqual ( val1 , val2 ) , factory . lessThanEqual ( val1 , val3 ) ) ) ; case JJTIN : Expression inExp = null ; Iterator inIterator = node . iterator ( ) ; val1 = getValue ( ( ( JPQLExpressionBuilder . JPQLNode ) ( inIterator . next ( ) ) ) ) ; while ( inIterator . hasNext ( ) ) { val2 = getValue ( ( ( JPQLExpressionBuilder . JPQLNode ) ( inIterator . next ( ) ) ) ) ; if ( ( ! ( val2 instanceof Literal ) ) && ( ( node . getChildCount ( ) ) == 2 ) ) <START_BUG> return factory . contains ( val2 , val1 ) ; <END_BUG> setImplicitTypes ( val1 , val2 , null ) ; if ( inExp == null ) inExp = factory . equal ( val1 , val2 ) ; else inExp = factory . or ( inExp , factory . equal ( val1 , val2 ) ) ; } return and ( evalNot ( not , inExp ) , factory . notEqual ( val1 , factory . getNull ( ) ) ) ; case JJTISNULL : if ( not ) return factory . notEqual ( getValue ( onlyChild ( node ) ) , factory . getNull ( ) ) ; else return factory . equal ( getValue ( onlyChild ( node ) ) , factory . getNull ( ) ) ; case JJTPATH : return getPathOrConstant ( node ) ; case JJTIDENTIFIER : case JJTIDENTIFICATIONVARIABLE : return getIdentifier ( node ) ; case JJTNOT : return factory . not ( getExpression ( onlyChild ( node ) ) ) ; case JJTLIKE : val1 = getValue ( left ( node ) ) ; val2 = getValue ( right ( node ) ) ; setImplicitType ( val1 , TYPE_STRING ) ; setImplicitType ( val2 , TYPE_STRING ) ; String escape = null ; JPQLExpressionBuilder . JPQLNode escapeNode = right ( node ) . findChildByID ( JJTESCAPECHARACTER , true ) ; if ( escapeNode != null ) escape = trimQuotes ( onlyChild ( escapeNode ) . text ) ; if ( not ) return factory . notMatches ( val1 , val2 , "_" , "%" , escape ) ; else return factory . matches ( val1 , val2 , "_" , "%" , escape ) ; case JJTISEMPTY : return evalNot ( not , factory . isEmpty ( getValue ( onlyChild ( node ) ) ) ) ; case JJTSIZE : return factory . size ( getValue ( onlyChild ( node ) ) ) ; case JJTUPPER : val1 = getValue ( onlyChild ( node ) ) ; setImplicitType ( val1 , TYPE_STRING ) ; return factory . toUpperCase ( val1 ) ; case JJTLOWER : return factory . toLowerCase ( getStringValue ( onlyChild ( node ) ) ) ;

Fix:
return evalNot ( not , factory . contains ( val2 , val1 ) ) ;