Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337779

Summary: Annotations not working with 0.7.0.201102210617
Product: [Technology] Tigerstripe Reporter: Steve Jerman <stjerman>
Component: AnnotationsAssignee: Project Inbox <tigerstripe.annotations-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nmehrega, skanton, yuri
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
337779 patch none

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!