This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 337779 - Annotations not working with 0.7.0.201102210617
Summary: Annotations not working with 0.7.0.201102210617
Status: VERIFIED FIXED
Alias: None
Product: Tigerstripe (Archived)
Classification: Technology
Component: Annotations (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 0.5M0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 17:33 EST by Steve Jerman CLA
Modified: 2011-03-16 17:47 EDT (History)
3 users (show)

See Also:


Attachments
337779 patch (1.47 KB, patch)
2011-03-07 03:08 EST, Anton Salnik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Jerman CLA 2011-02-21 17:33:14 EST
A simple plugin I have to list out annotations no longer seems to work headless (it did ....)

It seems to 'see' the annotation, (hasAnnotations returns true) but getAnnotation returns null.

Template:

#macro (annos $ob)
#if ($ob.hasAnnotations())#foreach($an in $ob.getAnnotations())
    --->  $an
#end
#end
#end
#foreach($a in $allEntities)
  $a.fullyQualifiedName
#annos($a)#foreach($f in $a.fields)
    - $f.name
#annos ( $f)#end
#end

Result:
 com.cisco.test.TestIt
    --->  $an
    - attribute0
    --->  $an
    --->  $an
  com.cisco.xmp.model.foundation.connectivity.PhysicalProtocolEndpoint
    - speed
    - portStatus
    - supportedSpeeds
    - isInternalPort
    - doAutoNegotiation
    - supportsAutoNegotiation
    - clocking
    - entPhysicalIndex
    - supportsAutoSpeed
    - supportedSpeedString
  com.cisco.xmp.model.foundation.connectivity.ConnectionProtocolEndpoint
  com.cisco.xmp.model.foundation.connectivity.InterfaceProtocolEndpointStatistics
    - ipepIndex
    - timeLastChange
    - nrInOctets
    - nrInUcastPkts
    - nrInDiscards
    - nrInErrors
    - nrInUnknownProtos
    - nrInMulticastPkts
    - nrInBroadcastPkts
    - nrOutOctets
Comment 1 Steve Jerman CLA 2011-02-21 17:34:18 EST
If you want to test, then my (small) test model is in GIT:

http://sjc-hudson20-lnx.cisco.com:8080/git/Tigerstripe-Tycho
Comment 2 Navid Mehregani CLA 2011-03-02 16:12:08 EST
The generator used is: annotation-poc/full-model-generator from the Git repo posted by Steve.  The model is annotation-poc/annotation-poc-module.
Comment 3 Anton Salnik CLA 2011-03-07 03:08:36 EST
Created attachment 190514 [details]
337779 patch

Source of the problem is com.cisco.xmpim.tsannotations plugin. It registers model for http://com.cisco.ts.annotations.xmp-im.core namespace. The same namespace is used in annotation-impl-model/core.ann annotations file. As registered model definition overrides model definition from annotation file and model definition from com.cisco.xmpim.tsannotations plugin doesn't contain InternalUseOnly, IsNetworkData, PalSchema... annotations the the namespace now, the annotation framework can resolve the annotations and returns null content during core.ann loading.

Attached patch fixes '$an' in output, now unresolved annotations with null content are ignored.
Comment 4 Anton Salnik CLA 2011-03-07 03:20:44 EST
Corrected comment:

Source of the problem is com.cisco.xmpim.tsannotations plugin. It registers model for http://com.cisco.ts.annotations.xmp-im.core namespace. The same namespace is used in annotation-impl-model/core.ann annotations file. As registered model definition overrides model definition from annotation file and model definition from com.cisco.xmpim.tsannotations plugin doesn't contain InternalUseOnly, IsNetworkData, PalSchema and other annotations in the http://com.cisco.ts.annotations.xmp-im.core namespace now, the annotation framework can't resolve content for the annotations during core.ann loading.

Attached patch fixes '$an' in output, now unresolved annotations are ignored.
Comment 5 Yuri Strot CLA 2011-03-07 06:36:21 EST
Patch applied.
Comment 6 Navid Mehregani CLA 2011-03-16 17:47:03 EDT
Verified. Thanks!