redhat-developer / redhat-developer/vscode-java

Copy of #1251 - Unsupported SuppressWarnings("restriction")

Open
#2,918 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compile diagnostics enhancement
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I am using a private JRE with its included libraries. As I import these I am given an error for Restricted Access since these are private APIs. If I were in Eclipse I could add @SuppressWarnings("restriction") and get rid of it.

That same class opened in VSCode will show the import as still an error and the '@SuppressWarnings' as "unnecessary".

Environment
  • Operating System: OS X 13.2
  • JDK version: Standard Edition (build 1.8.0_341-b10 13_Jul_2022_11_14 Mac OS X x64(SR7 FP15))
  • Visual Studio Code version: 1.75.0
  • Java extension version: 1.14.0
  1. Import a private API like from Sun
  2. Receive an "Access Restriction" Error
  3. Add @SuppressWarnings("restriction") to top of class declaration
Screenshot 2023-02-03 at 12 36 59

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code using the private JRE and the Java extension version described, following the import and @SuppressWarnings("restriction") steps. Start by tracing how the Java extension reports access-restriction diagnostics; done means the suppression is recognized and the import is no longer reported as an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.