Buggy code:
protected Class _cls = null ; private File _file = null ; public AnnotationPersistenceMetaDataParser ( OpenJPAConfiguration conf ) { } public OpenJPAConfiguration getConfiguration ( ) { } public Log getLog ( ) { } public MetaDataRepository getRepository ( ) { } public void setRepository ( MetaDataRepository repos ) { } public ClassLoader getEnvClassLoader ( ) { } public void setEnvClassLoader ( ClassLoader loader ) { } public boolean getMappingOverride ( ) { } public void setMappingOverride ( boolean override ) { } public int getMode ( ) { } public void setMode ( int mode , boolean on ) { } public void setMode ( int mode ) { } protected boolean isMetaDataMode ( ) { } protected boolean isQueryMode ( ) { } protected boolean isMappingMode ( ) { } protected boolean isMappingOverrideMode ( ) { } public void clear ( ) { } public void parse ( Class cls ) { } private void updateSourceMode ( ClassMetaData meta ) { } private void parsePackageAnnotations ( ) { } protected void parsePackageMappingAnnotations ( Package pkg ) { } protected boolean handleUnknownPackageAnnotation ( Package pkg , Annotation anno ) { } private int getSourceMode ( Package pkg ) { } private void addSourceMode ( Package pkg , int mode ) { } private ClassMetaData parseClassAnnotations ( ) { } protected void parseClassMappingAnnotations ( ClassMetaData meta ) { } protected boolean handleUnknownClassAnnotation ( ClassMetaData meta , Annotation anno ) { } private ClassMetaData getMetaData ( ) { } protected File getSourceFile ( ) { } private void parseDataStoreId ( ClassMetaData meta , DataStoreId id ) { } private void warnFlushMode ( Object context ) { } private void parseDataCache ( ClassMetaData meta , DataCache cache ) { } private void parseManagedInterface ( ClassMetaData meta , ManagedInterface iface ) { } private void parseDetachedState ( ClassMetaData meta , DetachedState detached ) { } private Collection < LifecycleCallbacks > [ ] parseEntityListeners ( ClassMetaData meta , EntityListeners listeners ) { } public static Collection < LifecycleCallbacks > [ ] parseCallbackMethods ( Class cls , Collection < LifecycleCallbacks > [ ] callbacks , boolean sups , boolean listener , MetaDataRepository repos ) { } private void recordCallbacks ( ClassMetaData cls , Collection < LifecycleCallbacks > [ ] callbacks , int [ ] highs , boolean superClass ) { } private void parseFetchGroups ( ClassMetaData meta , FetchGroup ... groups ) { } private void parseFetchAttribute ( ClassMetaData meta , org . apache . openjpa . meta . FetchGroup fg , FetchAttribute attr ) { } private void parseMemberAnnotations ( FieldMetaData fmd ) { } protected void parseMemberMappingAnnotations ( FieldMetaData fmd ) { } protected boolean handleUnknownMemberAnnotation ( FieldMetaData fmd , Annotation anno ) { } private static Class toOverrideType ( Class cls ) { } private void parseReadOnly ( FieldMetaData fmd , ReadOnly ro ) { } private void parseGeneratedValue ( FieldMetaData fmd , GeneratedValue gen ) { } static void parseGeneratedValue ( FieldMetaData fmd , GenerationType strategy , String generator ) { } private static int getGeneratedValueStrategy ( Object context , GenerationType strategy , String generator ) { } private void parseBasic ( FieldMetaData fmd , Basic anno , boolean lob ) { } private void parseManyToOne ( FieldMetaData fmd , ManyToOne anno ) { } private void parseOneToOne ( FieldMetaData fmd , OneToOne anno ) { } private void parseEmbedded ( FieldMetaData fmd , Embedded anno ) { } private void parseOneToMany ( FieldMetaData fmd , OneToMany anno ) { } private void parseManyToMany ( FieldMetaData fmd , ManyToMany anno ) { } private void parseMapKey ( FieldMetaData fmd , MapKey anno ) { } private void parseMapKeyClass ( FieldMetaData fmd , MapKeyClass anno ) { } private void parseMappedById ( FieldMetaData fmd , MappedById anno ) { } protected void parseLobMapping ( FieldMetaData fmd ) { } private void parseOrderBy ( FieldMetaData fmd , OrderBy anno ) { } private void parsePersistent ( FieldMetaData fmd , Persistent anno ) { } private void parsePersistentCollection ( FieldMetaData fmd , PersistentCollection anno ) { } private void parseElementCollection ( FieldMetaData fmd , ElementCollection anno ) { } private void parsePersistentMap ( FieldMetaData fmd , PersistentMap anno ) { } private void setCascades ( ValueMetaData vmd , CascadeType [ ] cascades ) { for ( CascadeType cascade : cascades ) { if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . REMOVE ) ) ) vmd . setCascadeDelete ( CASCADE_IMMEDIATE ) ; if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . PERSIST ) ) ) vmd . setCascadePersist ( CASCADE_IMMEDIATE ) ; if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . MERGE ) ) ) vmd . setCascadeAttach ( CASCADE_IMMEDIATE ) ; <START_BUG> if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . CLEAR ) ) ) <END_BUG> vmd . setCascadeDetach ( CASCADE_IMMEDIATE ) ; if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . REFRESH ) ) ) vmd . setCascadeRefresh ( CASCADE_IMMEDIATE ) ; } } private void setOrphanRemoval ( ValueMetaData vmd , boolean orphanRemoval ) { } private void parseSequenceGenerator ( AnnotatedElement el , SequenceGenerator gen ) { } private void parseNamedQueries ( AnnotatedElement el , NamedQuery ... queries ) { } private void parseNamedNativeQueries ( AnnotatedElement el , NamedNativeQuery ... queries ) { } private static class MethodKey { private final Method _method ; public MethodKey ( Method m ) { } public int hashCode ( ) { } public boolean equals ( Object o ) { } } private static class MethodComparator implements Comparator { private static AnnotationPersistenceMetaDataParser . MethodComparator INSTANCE = null ; public static AnnotationPersistenceMetaDataParser . MethodComparator getInstance ( ) { } public int compare ( Object o1 , Object o2 ) { } } }

Fix:
if ( ( cascade == ( CascadeType . ALL ) ) || ( cascade == ( CascadeType . DETACH ) ) )