Buggy code:
public void evictAll ( ) { } public void evictAll ( Class cls ) { } public void evictAll ( Extent extent ) { } @ SuppressWarnings ( "unchecked" ) public < T > T detachCopy ( T entity ) { } public Object [ ] detachAll ( Object ... entities ) { } public Collection detachAll ( Collection entities ) { } @ SuppressWarnings ( "unchecked" ) public < T > T merge ( T entity ) { } public Object [ ] mergeAll ( Object ... entities ) { } public Collection mergeAll ( Collection entities ) { } public void transactional ( Object entity , boolean updateVersion ) { } public void transactionalAll ( Collection objs , boolean updateVersion ) { } public void transactionalAll ( Object [ ] objs , boolean updateVersion ) { } public void nontransactional ( Object entity ) { } public void nontransactionalAll ( Collection objs ) { } public void nontransactionalAll ( Object [ ] objs ) { } public Generator getNamedGenerator ( String name ) { } public Generator getIdGenerator ( Class forClass ) { } public Generator getFieldGenerator ( Class forClass , String fieldName ) { } public < T > Extent < T > createExtent ( Class < T > cls , boolean subclasses ) { } public OpenJPAQuery createQuery ( String query ) { } public OpenJPAQuery createQuery ( String language , String query ) { } public OpenJPAQuery createQuery ( Query query ) { } public OpenJPAQuery createNamedQuery ( String name ) { } public OpenJPAQuery createNativeQuery ( String query ) { } public OpenJPAQuery createNativeQuery ( String query , Class cls ) { } public OpenJPAQuery createNativeQuery ( String query , String mappingName ) { } private static void validateSQL ( String query ) { } PreparedQueryCache getPreparedQueryCache ( ) { } PreparedQuery getPreparedQuery ( String id ) { } public void setFlushMode ( FlushModeType flushMode ) { } public FlushModeType getFlushMode ( ) { } static FlushModeType fromFlushBeforeQueries ( int flush ) { } static int toFlushBeforeQueries ( FlushModeType flushMode ) { } public void clear ( ) { } public Object getDelegate ( ) { } public LockModeType getLockMode ( Object entity ) { } public void lock ( Object entity , LockModeType mode ) { } public void lock ( Object entity ) { } public void lock ( Object entity , LockModeType mode , int timeout ) { } public void lock ( Object entity , LockModeType mode , Map < String , Object > properties ) { } public void lockAll ( Collection entities ) { } public void lockAll ( Collection entities , LockModeType mode , int timeout ) { } public void lockAll ( Object ... entities ) { } public void lockAll ( Object [ ] entities , LockModeType mode , int timeout ) { } public boolean cancelAll ( ) { } public Object getConnection ( ) { } public Collection getManagedObjects ( ) { } public Collection getTransactionalObjects ( ) { } public Collection getPendingTransactionalObjects ( ) { } public Collection getDirtyObjects ( ) { } public boolean getOrderDirtyObjects ( ) { } public void setOrderDirtyObjects ( boolean order ) { } public void dirtyClass ( Class cls ) { } @ SuppressWarnings ( "unchecked" ) public Collection < Class > getPersistedClasses ( ) { } @ SuppressWarnings ( "unchecked" ) public Collection < Class > getUpdatedClasses ( ) { } @ SuppressWarnings ( "unchecked" ) public Collection < Class > getRemovedClasses ( ) { } public < T > T createInstance ( Class < T > cls ) { } public void close ( ) { } public boolean isOpen ( ) { } public void dirty ( Object o , String field ) { } public Object getObjectId ( Object o ) { } public boolean isDirty ( Object o ) { } public boolean isTransactional ( Object o ) { } public boolean isPersistent ( Object o ) { } public boolean isNewlyPersistent ( Object o ) { } public boolean isRemoved ( Object o ) { } public boolean isDetached ( Object entity ) { } public Object getVersion ( Object o ) { } void assertNotCloseInvoked ( ) { } void assertValidAttchedEntity ( Object entity ) { } public Object processArgument ( Object arg ) { } public Object processReturn ( Object oid , OpenJPAStateManager sm ) { } public int processArgument ( int op , Object obj , OpenJPAStateManager sm ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } public void writeExternal ( ObjectOutput out ) throws IOException { } private static class BrokerBytesInputStream extends ObjectInputStream { private OpenJPAConfiguration conf ; BrokerBytesInputStream ( byte [ ] bytes , OpenJPAConfiguration conf ) throws IOException { } private Class primitiveType ( char type ) { } protected Class resolveClass ( ObjectStreamClass classDesc ) throws IOException , ClassNotFoundException { } private Class lookupClass ( String className ) throws ClassNotFoundException { } } public void detach ( Object entity ) { } public Query createQuery ( CriteriaQuery criteriaQuery ) { } public OpenJPAQuery createDynamicQuery ( QueryDefinition qdef ) { } public Map < String , Object > getProperties ( ) { } public QueryBuilder getQueryBuilder ( ) { <START_BUG> return null ; <END_BUG> } public Set < String > getSupportedProperties ( ) { } public < T > T unwrap ( Class < T > cls ) { } public void setQuerySQLCache ( boolean flag ) { } public boolean getQuerySQLCache ( ) { } RuntimeExceptionTranslator getExceptionTranslator ( ) { } private void processLockProperties ( FetchPlan fPlan , LockModeType mode , Map < String , Object > properties ) { } public Metamodel getMetamodel ( ) { } public void setProperty ( String arg0 , Object arg1 ) { } }

Fix:
return _emf . getQueryBuilder ( ) ;