Hi, Richard:
I think I understood the whole story.
Back in 2011, some developers have been setting their Eclipse preference "Field
declaration hides another field or variable" to "Warning", whereas the
default is "Ignore". This exposed a problem with the JCasGen generated Java
classes where a sub-class declares variables that are already available in
its super class. Hence, Eclipse throw this as a warning. In order to make
it go away, it will require the @SuppressWarning("hiding"). That's what
initiated the requirement with UIMA-1983.
I haven't experienced this problem at all because we have been using the
default Eclipse setting with "Field declaration hides another field or
variable" set to "Ignore". So the @SuppressWarning("hiding") added by
UIMA-1983 actually becomes unnecessary under default settings and causes
new warnings like "Unnecessary @SuppressWarning". We didn't know what
really happened, so we coped with it by changing "Unused @SuppressWarnings
token" from "Warning" to "Ignore" to make them go away.
Now that we know the history behind it, it boils down to either we tweak
the "Field declaration hides another field or variable" setting or "Unused
@SuppressWarnings token" settings, in order to get a clean compile. I
actually find the more rigorous check on "Field declaration hides another
field or variable" quite useful, and wouldn't mind adopting this Eclipse
setting too.
--
James
On Mon, Aug 17, 2015 at 7:18 AM, Richard Eckart de Castilho (JIRA) <
[email protected]> wrote:
>
> [
> https://issues.apache.org/jira/browse/UIMA-4554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14699576#comment-14699576
> ]
>
> Richard Eckart de Castilho edited comment on UIMA-4554 at 8/17/15 2:17 PM:
> ---------------------------------------------------------------------------
>
> I cannot remember having seen such warnings in Maven builds that use
> javac. But when I turned the "Field declaration hides another field or
> variable" to "warning" in Eclipse, the SupressWarnings ("hiding")
> warnings were gone.
>
> This post on stack overflow has a good overview. The "hiding" option seems
> to be coming from Eclipse's compiler, not from javac:
>
>
> http://stackoverflow.com/questions/1205995/what-is-the-list-of-valid-suppresswarnings-warning-names-in-java
>
> This appears to be the list supported by Oracle Java 1.8.0:
>
> * all
> * auxiliaryclass
> * cas
> * classfile
> * deprecation
> * dep-ann
> * divzero
> * empty
> * fallthrough
> * finally
> * options
> * overloads
> * overrides
> * path
> * processing
> * rawtypes
> * serial
> * static
> * try
> * unchecked
> * varargs
>
>
>
> was (Author: rec):
> I cannot remember having seen such warnings in Maven builds that use
> javac. But when I turned the "Field declaration hides another field or
> variable" to "warning" in Eclipse, the SupressWarnings ("hiding")
> warnings were gone.
>
> This post on stack overflow has a good overview. The "hiding" option seems
> to be coming from Eclipse's compiler, not from javac:
>
>
> http://stackoverflow.com/questions/1205995/what-is-the-list-of-valid-suppresswarnings-warning-names-in-java
>
> > 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, 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)
>