Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 245240 - [preferences] Add preference for new compiler warning: MissingSynchronizedModifierInInheritedMethod
Summary: [preferences] Add preference for new compiler warning: MissingSynchronizedMod...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M2   Edit
Assignee: Benjamin Muskalla CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-26 07:51 EDT by Philipe Mulet CLA
Modified: 2008-09-02 09:54 EDT (History)
3 users (show)

See Also:
markus.kell.r: review+


Attachments
patch (5.05 KB, patch)
2008-08-26 14:09 EDT, Benjamin Muskalla CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2008-08-26 07:51:10 EDT
3.5

As a follow up of bug 239066, some UI work is indeed to surface the new compiler warning.

fyi:
Added a new compiler warning to signal absence of synchronized modifier when overriding a synchronized method. This diagnosis is controlled by option: JavaCore.COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD and produces a problem marker which ID is IProblem.MissingSynchronizedModifierInInheritedMethod problem ID.

  Compiler option ID: Reporting Missing Synchronized Modifier On Inherited Method.
  When enabled, the compiler will issue an error or a warning if a method
  overrides a synchronized method without having a synchronized modifier.
  Option id: "org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"
  Possible values: { "error", "warning", "ignore" }
  Default: "warning"


This should appear in Potential Programming Problems section.
Comment 1 Benjamin Muskalla CLA 2008-08-26 08:34:03 EDT
Will take this one if nobody disapproves.
Comment 2 Dani Megert CLA 2008-08-26 09:43:30 EDT
Sure, thanks.
Comment 3 Markus Keller CLA 2008-08-26 10:06:52 EDT
A quick fix would also be nice (and easy to add, see ModifierCorrectionSubProcessor#addNonFinalLocalProposal(..) for a template).
Comment 4 Benjamin Muskalla CLA 2008-08-26 10:12:13 EDT
Yep, I already have a quick fix for that somewhere in my workspace ;-)

I opened a seperate issue for that request. See bug 245250
Comment 5 Benjamin Muskalla CLA 2008-08-26 14:09:01 EDT
Created attachment 110978 [details]
patch

Here is the patch to support the new compiler warning in the ui.

One thing which bothered me are the missing tests for this kind of stuff. The only thing I can see is the PreferencesTest which seems to be completely broken. Does anybody really uses these tests?
I could imagine to have a test which compares ProblemSeverityBlock#getKeys with the JavaCore constants to see if UI doesn't forget anything. But I think the two are just too different to have a generic test case for that scenario.
Comment 6 Markus Keller CLA 2008-09-02 04:43:47 EDT
Thanks, released to HEAD (and fixed copyright headers).

We currently don't have tests for this mapping, although it would maybe be interesting to see missing preferences.
Comment 7 Markus Keller CLA 2008-09-02 09:54:19 EDT
> I could imagine to have a test which compares ProblemSeverityBlock#getKeys with
> the JavaCore constants to see if UI doesn't forget anything. But I think the
> two are just too different to have a generic test case for that scenario.

I added such a test, see OptionsConfigurationBlockTest in HEAD.