Hi Chris, This does look quite strange. My guess is that either the schema that this is generated from is invalid, causing the generator to generate this weird init method, or there's a subtle bug in the generator that the schema is bringing out. Either way, it would be good if you could provide us with the schema, or a test schema that has the same effect on the init method.
Thanks, Frank. "Raymond Feng" <[EMAIL PROTECTED]> wrote on 08/30/2006 05:40:13 PM: > Hi, Chris, > > Usually MedRecWebServicesPackageImpl.eINSTANCE.eClass() should not be called > in MedRecWebServicesPackageImpl.init() method. It seems to be a > code-generation issue. Frank, Fuwei or Yang, any idea? > > Thanks, > Raymond > > ----- Original Message ----- > From: "Chris Wall" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Wednesday, August 30, 2006 2:12 PM > Subject: tuscany-sdo-plugin produces NPE > > > > Hi. Within the EPackageImpl implementing class generated by > > tuscany-sdo-plugin, the init() method calls a method on an instance of > > itself before the instance is initialized. For example: > > > > <snippet> > > > > public static MedRecWebServicesPackageImpl init() > > { > > if (isInited) return > > (MedRecWebServicesPackageImpl)EPackage.Registry.INSTANCE.getEPackage( > > MedRecWebServicesPackageImpl.eNS_URI); > > > > // Obtain or create and register package > > MedRecWebServicesPackageImpl theMedRecWebServicesPackageImpl = > > (MedRecWebServicesPackageImpl)(EPackage.Registry.INSTANCE. > getEPackage(eNS_URI) > > instanceof MedRecWebServicesPackageImpl ? > > EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new > > MedRecWebServicesPackageImpl()); > > > > isInited = true; > > > > // Initialize simple dependencies > > MedRecWebServicesPackageImpl.eINSTANCE.eClass(); <---- P R O D U C E > > S N P E > > SDOPackageImpl.eINSTANCE.eClass(); > > ModelPackageImpl.eINSTANCE.eClass(); > > > > </snippet> > > > > The eClass() method needs to be called on theMedRecWebServicesPackageImpl, > > called later in the process once eINSTANCE is initialized, or eINSTANCE > > needs to not be declared final. > > > > Thanks. > > > > -Chris > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
