On 17.08.2015, at 17:50, James Jichun Zhu <[email protected]> wrote: > 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.
I wouldn't mind it either, but we should also keep those in mind that are not familiar with the history and that hit the same problem as you did: being confused about these warnings. Marshall is right: this should be reported upstream to Eclipse as a bug. I'm also for keeping the annotations, but also adding a comment in the generated source code pointing to the settings in Eclipse and possibly the Jira issues such that those who run Eclipse with the default settings and who investigate the source of the problem quickly find the right pointers. Another thing: generating those annotations or not could be made an option in JCasGen (maybe?) and be turned off by default. Those people that run with the non-default settings in Eclipse could then turn it on. WDYT? Cheers, -- Richard
