Buggy code:
class ValueClassModel { private static String capitalize ( String s ) { } private static String decapitalize ( String s ) { } private static boolean isNullable ( JVar param ) throws SourceException { } private final JDefinedClass valueClass ; private final JDefinedClass acceptingInterface ; private final ValueVisitorInterfaceModel visitorInterface ; private final Types types ; ValueClassModel ( JDefinedClass valueClass , JDefinedClass acceptingInterface , ValueVisitorInterfaceModel visitorInterface , Types modelTypes ) { } JDefinedClass getJDefinedClass ( ) { } ValueClassModel . MethodBuilder createMethodBuilder ( Serialization serialization ) throws JClassAlreadyExistsException { } private JFieldVar buildAcceptorField ( ) { } JMethod buildFactory ( Map < String , JMethod > constructorMethods ) throws JClassAlreadyExistsException { } private JDefinedClass buildFactoryClass ( Map < String , JMethod > constructorMethods ) throws JClassAlreadyExistsException { } private Map < String , JDefinedClass > buildCaseClasses ( Serialization serialization ) throws JClassAlreadyExistsException { } private JDefinedClass buildCaseClass ( JMethod interfaceMethod , Serialization serialization ) throws JClassAlreadyExistsException { JDefinedClass caseClass = valueClass . _class ( ( ( JMod . PRIVATE ) | ( JMod . STATIC ) ) , ( ( ( ValueClassModel . capitalize ( interfaceMethod . name ( ) ) ) + "Case" ) + ( acceptingInterface . name ( ) ) ) ) ; for ( JTypeVar visitorTypeParameter : acceptingInterface . typeParams ( ) ) { Types . generifyWithBoundsFrom ( caseClass , visitorTypeParameter . name ( ) , visitorTypeParameter ) ; } AbstractJClass usedAcceptingInterfaceType = acceptingInterface . narrow ( caseClass . typeParams ( ) ) ; AbstractJClass usedValueClassType = valueClass . narrow ( caseClass . typeParams ( ) ) ; caseClass . _implements ( usedAcceptingInterfaceType ) ; if ( serialization . isSerializable ( ) ) { caseClass . _implements ( types . _Serializable ) ; <START_BUG> caseClass . field ( ( ( ( JMod . PRIVATE ) | ( JMod . FINAL ) ) | ( JMod . STATIC ) ) , types . _long , "serialVersionUID" , JExpr . lit ( serialization . serialVersionUID ( ) ) ) ; <END_BUG> } JMethod constructor = caseClass . constructor ( NONE ) ; for ( JVar param : interfaceMethod . params ( ) ) { AbstractJType paramType = visitorInterface . substituteSpecialType ( param . type ( ) , usedValueClassType , usedValueClassType , types . _RuntimeException ) ; JFieldVar field = caseClass . field ( ( ( JMod . PRIVATE ) | ( JMod . FINAL ) ) , paramType , param . name ( ) ) ; JVar argument = constructor . param ( paramType , param . name ( ) ) ; constructor . body ( ) . assign ( JExpr . _this ( ) . ref ( field ) , argument ) ; } JVar param = interfaceMethod . listVarParam ( ) ; if ( param != null ) { AbstractJType paramType = visitorInterface . substituteSpecialType ( param . type ( ) . elementType ( ) , usedValueClassType , usedValueClassType , types . _RuntimeException ) ; JFieldVar field = caseClass . field ( ( ( JMod . PRIVATE ) | ( JMod . FINAL ) ) , paramType . array ( ) , param . name ( ) ) ; JVar argument = constructor . varParam ( paramType , param . name ( ) ) ; constructor . body ( ) . assign ( JExpr . _this ( ) . ref ( field ) , argument ) ; } JMethod acceptMethod = caseClass . method ( PUBLIC , types . _void , "accept" ) ; acceptMethod . annotate ( Override . class ) ; JTypeVar visitorResultType = visitorInterface . getResultTypeParameter ( ) ; JTypeVar resultType = Types . generifyWithBoundsFrom ( acceptMethod , visitorResultType . name ( ) , visitorResultType ) ; acceptMethod . type ( resultType ) ; JTypeVar visitorExceptionType = visitorInterface . getExceptionTypeParameter ( ) ; JTypeVar exceptionType = null ; if ( visitorExceptionType != null ) { exceptionType = Types . generifyWithBoundsFrom ( acceptMethod , visitorExceptionType . name ( ) , visitorExceptionType ) ; acceptMethod . _throws ( exceptionType ) ; } AbstractJClass usedVisitorType = visitorInterface . narrowed ( usedValueClassType , resultType , exceptionType ) ; acceptMethod . param ( usedVisitorType , "visitor" ) ; JInvocation invocation = JExpr . invoke ( JExpr . ref ( "visitor" ) , interfaceMethod . name ( ) ) ; for ( JVar param1 : interfaceMethod . params ( ) ) { invocation . arg ( JExpr . _this ( ) . ref ( param1 . name ( ) ) ) ; } JVar param1 = interfaceMethod . listVarParam ( ) ; if ( param1 != null ) { invocation . arg ( JExpr . _this ( ) . ref ( param1 . name ( ) ) ) ; } acceptMethod . body ( ) . _return ( invocation ) ; return caseClass ; } Map < String , FieldConfiguration > getGettersConfigutation ( ) throws SourceException { } Map < String , FieldConfiguration > getUpdatersConfiguration ( ) throws SourceException { } Set < String > getPredicates ( ) throws SourceException { } class MethodBuilder { private final Map < String , JDefinedClass > caseClasses ; private final JFieldVar acceptorField ; private MethodBuilder ( Map < String , JDefinedClass > caseClasses , JFieldVar acceptorField ) { } void buildPrivateConstructor ( ) { } void buildProtectedConstructor ( Serialization serialization ) throws JClassAlreadyExistsException { } void buildAcceptMethod ( ) { } Map < String , JMethod > buildConstructorMethods ( Serialization serialization ) throws SourceException , JClassAlreadyExistsException { } void buildHashCodeMethod ( int hashCodeBase ) throws SourceException { } void buildToStringMethod ( ) throws SourceException { } void generateGetter ( FieldConfiguration configuration ) { } void generateUpdater ( FieldConfiguration configuration ) throws SourceException { } void generatePredicate ( String name ) { } void buildEqualsMethod ( ) throws SourceException , JClassAlreadyExistsException { } void buildCompareTo ( ) throws SourceException , JClassAlreadyExistsException { } } }

Fix:
caseClass . field ( ( ( ( JMod . PRIVATE ) | ( JMod . FINAL ) ) | ( JMod . STATIC ) ) , types . _long , "serialVersionUID" , JExpr . lit ( serialization . serialVersionUIDForGeneratedCode ( ) ) ) ;