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

Marshall Schor commented on UIMA-4554:
--------------------------------------

I did some more investigation.  It turns out that a change was made a long time 
ago (June, 2007) as part of UIMA-386, that made the generation of the 
fsGenerator code by JcasGen superfluous.  Individually created generators were 
replaced by a generic one.  You can see evidence of this by looking in the 
following spots:  FSClassRegistry lines 185 +,  JCasImpl lines 800 + (the 
replacement), TOP_Type line 91, etc. 

So, except perhaps for some unforeseen issues around compatibility with classes 
that extend these, we could remove these entirely...  

The TOP_Type keeps these (due to backwards compatibility concerns) but gets 
around the raw type and unchecked warnings by changing
{code}
  protected FSGenerator getFSGenerator() {
{code} to
{code}
 protected FSGenerator<?> getFSGenerator() {
{code}

If that works, I'd recommend that above the suppress warnings, and I'd drop the 
generation of the 
{code}
private FSGenerator fsGenerator = new FSGenerator() .... 
{code} altogether.

> 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, 
> 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