[ 
https://issues.apache.org/jira/browse/UIMA-4554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14905125#comment-14905125
 ] 

James Zhu commented on UIMA-4554:
---------------------------------

Hi, Marshall:

I did a lookup to see where the getFSGenerator() is ever called and found three 
places, all of similar nature. For instance,

public AnnotationBase_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, 
getFSGenerator());

    casFeat_sofa = jcas.getRequiredFeatureDE(casType, "sofa", "uima.cas.Sofa", 
featOkTst);
    casFeatCode_sofa = (null == casFeat_sofa) ? JCas.INVALID_FEATURE_CODE
            : ((FeatureImpl) casFeat_sofa).getCode();
  }

The other two places are in public Annotation_Type(JCas jcas, Type casType) 
constructor and protected TOP_Type(JCas jcas, Type casType, boolean 
installGenerator) constructor. All structured similarly.

If you further follow the call to addGeneratorForType(), it does not do 
anything. That means, regardless of whether the JCasGen generated Java class 
re-declares the fsGenerator variable or getFSGenerator() method or not, they 
are not used. Instead, the fsGenerator variable and getFSGenerator() method 
declared on the base class, AnnotationBase_Type, etc, will be used instead and 
they don't do anything either.

Even if some user has JCasGen generated Java code from previous version that 
re-declares the fsGenerator variable and getFSGenerator() method, in the new 
UIMA distro at run time, they will be referenced instead of the fsGenerator 
variable and getFSGenerator() method on the base class, and once again they do 
nothing in addGeneratorForType(). So it still will not break anything.

So, I hope I can convince ourselves that it is not possible to break anybody 
when the new JCasGen stop producing the fsGenerator variable and 
getFSGenerator() method that shadows those declared on the base classes, 
namely, AnnotationBase_Type, Annotation_Type, TOP_Type.  

> JCasGen generating rawType warnings for fsGenerator
> ---------------------------------------------------
>
>                 Key: UIMA-4554
>                 URL: https://issues.apache.org/jira/browse/UIMA-4554
>             Project: UIMA
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.8.1SDK
>            Reporter: Marshall Schor
>            Priority: Minor
>             Fix For: 2.8.2SDK
>
>         Attachments: UIMA-4554 patch 2015-08-15 - uimaj-jet-expander.patch, 
> UIMA-4554 patch 2015-08-15.patch, UIMA-4554 patch 2015-08-16.patch, UIMA-4554 
> patch 2015-08-18.patch, UIMA-4554 patch 2015-08-21.patch, UIMA-4554 patch 
> 2015-08-23 - remove fsGenerator.patch, uimaj-tools-UIMA-4554-2015-08-11.patch
>
>
> JCasGen generate references to FsGenerator which was changed in 2.8.0 to have 
> generic type information.  So the resulting generated code causes warnings 
> about raw types being used.  Workaround - add a 
> @SuppressWarnings("rawtypes"), but a better thing would be to add the proper 
> generic arguments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to