Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] New Attribute added in internal.ecore

I suspect the problem is the original code was generated with a much older version of EMF.  I think we simply need to fix the errors manually...

Jesse

On Thu, May 20, 2010 at 7:16 AM, Trupti Pol <ktrup7@xxxxxxxxx> wrote:

Hi Jesse,Andrea

I tried to generate only subpart of the original model i.e. since i am
adding a new attribute in Map element i tried and regenrated the model code
for Map only.

But in this case the newly genearted code is not in sync with old one. Again
the new code has the 4 problems as listed below and thus application
generates null pointer exception.

This nullPointerException is because old code tries to comunicate with
EStructuralFeature for eGet and eSet methods where as new code has int
featureId. Thus in the new code EStructuralFeature feature is null.

Please tell  me what to do about this? waiting eagorously for the reply.



Jesse Eichar-4 wrote:
>
> Hi thanks for looking into this.  Andrea and I performed the operation
> last
> year so I know it is possible.  I will try to take a look and see what is
> up.
>
> One think you might consider (if you haven't already) is try to reduce the
> generation to just the model that you need to change.  So rather than the
> entire model maybe just a subtree.
>
> Jesse
>
> On Wed, May 19, 2010 at 2:17 PM, Trupti Pol <ktrup7@xxxxxxxxx> wrote:
>
>>
>> Hi Andrea,
>>
>> if reload models from java interfaces then there is no modifications in
>> the
>> model and ecore files.
>> But if i try and regenerate model code from these models then i get the
>> compiler errors.
>>
>> Currently what i have done is
>>  1) added one extra attribute in internal.ecore
>>  2) generated the model code
>>
>> It gives me compiler errors. Following problems are prominent.
>>   1) .java file method's signatures are changing.
>>   2) every .java file has copyright string declaration missing.
>>   3) Instead of retrieving information from ProjectPackage.eINSTANCE.**
>> now
>> the statement is modified to ProjectPackage.Literals.**
>>   4) eGet() and eSet() methods instead of using EStructuralFeature now
>> uses
>> int featureID
>>
>> Please tell me about how to get model and code in sync with each other?
>> Also
>> give me some pointers about handling above issues.
>>
>>
>>
>>
>> Andrea Antonello-3 wrote:
>> >
>> > Hi Trupti,
>> > I contacted Jesse offlist and he gave some direction, which I paste
>> > here in the hope you can find them usefull.
>> >
>> > --------8<----------------
>> > The process that I normally use to edit the model is:
>> >
>> > - make sure all work is committed
>> > - generate from model and see what changes
>> > - if compile errors revert all changes.  Reload models from java
>> > interfaces
>> >   generate model and see what changes are made.
>> > - Verify udig still works (because sometimes people change a generated
>> > method and forget to mark it as modified)
>> > - Change the model
>> > - generate
>> >
>> > That tends to work fairly well
>> > -------->8----------------
>> >
>> > Good luck,
>> > Andrea
>> >
>> >
>> >
>> >
>> > On Tue, May 18, 2010 at 12:02 PM, Trupti Pol <ktrup7@xxxxxxxxx> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I have added a new attribute called as rotation in internal.ecore to
>> >> modify
>> >> the EMF model.
>> >>
>> >> After this i regenerated the emf code. But now after regenerating code
>> i
>> >> get
>> >> following errors
>> >>
>> >> 1) ProjectFactoryImpl.java
>> >> 2) ProjectPackageImpl.java
>> >>   These two files have two import statements added for
>> >> "org.geotools.data.FeatureResults" and
>> >>  "org.geotools.feature.SimpleFeature"
>> >> which cannot be resolved. (i.e unable find these classes in geotools)
>> >>
>> >> 3)StyleEntryImpl.java has got
>> >>
>> >>            /**
>> >>         * The cached style class.
>> >>         *
>> >>         * @generated NOT
>> >>         */
>> >>        private Class styleClass = STYLE_CLASS_EDEFAULT;
>> >>
>> >>     where it gives error as
>> >>             - STYLE_CLASS_EDEFAULT cannot be resolved
>> >>
>> >> Does this means that ecore model and actual code are not in sync ?
>> >>
>> >>
>> >> -----
>> >> Thanks & Regards,
>> >> Trupti Pol
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/New-Attribute-added-in-internal.ecore-tp28593846p28593846.html
>> >> Sent from the udig-devel mailing list archive at Nabble.com.
>> >>
>> >> _______________________________________________
>> >> User-friendly Desktop Internet GIS (uDig)
>> >> http://udig.refractions.net
>> >> http://lists.refractions.net/mailman/listinfo/udig-devel
>> >>
>> > _______________________________________________
>> > User-friendly Desktop Internet GIS (uDig)
>> > http://udig.refractions.net
>> > http://lists.refractions.net/mailman/listinfo/udig-devel
>> >
>> >
>>
>>
>> -----
>> Thanks & Regards,
>> Trupti Pol
>> --
>> View this message in context:
>> http://old.nabble.com/New-Attribute-added-in-internal.ecore-tp28593846p28607365.html
>> Sent from the udig-devel mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>


-----
Thanks & Regards,
Trupti Pol
--
View this message in context: http://old.nabble.com/New-Attribute-added-in-internal.ecore-tp28593846p28617298.html
Sent from the udig-devel mailing list archive at Nabble.com.

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top