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

Richard Eckart de Castilho commented on UIMA-4554:
--------------------------------------------------

I have had a look at the patch and I think it looks pretty good in general. 

I am unsure about one change:

{noformat}
<% if ("Annotation".equals(jg.getJavaName(td.getSupertypeName()))) {%>
  @SuppressWarnings({ "rawtypes", "unchecked" })
<% } else {%>
  @SuppressWarnings("rawtypes")
<% } %>
{noformat}

This looks like potential trouble for two reasons:

* if checks the short class name without the package name. Maybe a check like 
{{<% if (td.getName().equals("uima.cas.Annotation")) { %>}} would be more 
adequate?
* it checks the the immediate supertype - what about types that have 1+ 
intermediate supertypes until "Annotation" is reached

Anyway, wouldn't it be possible to use the correct parametrization instead of 
using @SuppressWarnings("rawtypes")?

Another comment would be that the patch actually seems to address multiple 
unrelated problems:

# the "FSGenerator is a raw type. References to generic type FSGenerator<T> 
should be parameterized AAA_Type.java" warnings 
# the warnings about the unnecessary @SuppressWarnings("rawtypes")
# the problem that the jet-expander module doesn't work on Linux/OS X

Normally, I would suggest to have separate issues for these and separate 
patches - but a at least the first two were discussed in this issue and the 
last one is easy to separate out when we apply the patch.

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