Bug 508709 - [tests] Fix the Discouraged access warnings in jdt.core.tests.model
Summary: [tests] Fix the Discouraged access warnings in jdt.core.tests.model
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-06 01:31 EST by Jay Arthanareeswaran CLA
Modified: 2022-11-30 17:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Arthanareeswaran CLA 2016-12-06 01:31:49 EST
There are several Discouraged access warnings in jdt.core.tests.model in the official build, such as the latest:

http://download.eclipse.org/eclipse/downloads/drops4/I20161205-2000/compilelogs/plugins/org.eclipse.jdt.debug_3.11.0.v20161130-0636/jdimodel.jar.html#DISCOURAGED_WARNINGS

Currently in dev environment this is set to ignore, so we don't see them. When we have time, we should look at these and either fix these or make an exception for this project in tycho set up.
Comment 1 Stephan Herrmann CLA 2016-12-06 09:44:26 EST
And here's the link for jdt.core.tests.model: http://download.eclipse.org/eclipse/downloads/drops4/I20161205-2000/compilelogs/plugins/org.eclipse.jdt.core.tests.model_3.10.300.v20161205-1547/@dot.html

:)

Of course that link will go stale soon. 
Extracting the the first few from a long list, the warnings affect references to

- org.eclipse.jdt.internal.formatter.DefaultCodeFormatter
- fields of DefaultCodeFormatterOptions
- org.eclipse.jdt.internal.compiler.impl.CompilerOptions
- org.eclipse.jdt.internal.core.search.matching.PatternLocator
- org.eclipse.jdt.internal.core.ClasspathEntry
- ...

> Currently in dev environment this is set to ignore, so we don't see them.

Should we just change our settings to "warning"?

Otherwise, with latest compiler when we use @SuppressWarnings("restriction"), we'd get the following info as the answer:

  At least one of the problems in category 'restriction' is not analysed due to a compiler option being ignored

:)
Comment 2 Stephan Herrmann CLA 2016-12-06 09:47:56 EST
I quickly pondered about added core.tests.model to the x-friends of the corresponding packages, but so far we don't use x-friends for tests, only for things like APT and API tools. Is that a conscious decision or mere coincidence?
Comment 3 Jay Arthanareeswaran CLA 2016-12-06 23:17:20 EST
(In reply to Stephan Herrmann from comment #2)
> I quickly pondered about added core.tests.model to the x-friends of the
> corresponding packages, but so far we don't use x-friends for tests, only
> for things like APT and API tools. Is that a conscious decision or mere
> coincidence?

Not sure. Will there be any problems for consumers of jdt.core in the absence of test.model bundles? 

(In reply to Stephan Herrmann from comment #1)
> Should we just change our settings to "warning"?

There are quite a few places to fix and more than 4000 warnings as of today. Do you see problems with making the tycho build reflect our dev environment preference of "ignore" ?
Comment 4 Stephan Herrmann CLA 2016-12-07 15:38:24 EST
(In reply to Jay Arthanareeswaran from comment #3)
> There are quite a few places to fix and more than 4000 warnings as of today.
> Do you see problems with making the tycho build reflect our dev environment
> preference of "ignore" ?

Even if 4000 warnings can be silenced by - say - 50 class-level @SW, telling tycho to be more lenient sounds fine to me.
Comment 5 Manoj N Palat CLA 2018-05-16 01:06:47 EDT
bulk move out of 4.8
Comment 6 Eclipse Genie CLA 2020-06-18 16:52:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2022-11-30 17:54:05 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.