2

I have a method using sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders"); which I want to replace (or suppress the warning if possible). Can I replace it with anything not Sun properietary so it doesn't throw warnings on some possible removals?

--

UPDATE: not sure if the code is needed at all. It's in a legacy code and I was asked to remove all compile warnings. The one particular with the ShellFolder goes the following:

new Thread {
  public void run() {
    ShellFolder.get("fileChooserComboBoxFolders");
  }
}.start();

--

UPDATE #2 on why it was needed: JFileChooser is still a bit buggy.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
András Hummer
  • 960
  • 1
  • 17
  • 35

3 Answers3

0

The only solution to avoid this warning is not to use sun.awt.shell.ShellFolder.get

Paniz
  • 594
  • 6
  • 19
0

You can suppress warnings by using @SuppressWarnings("all") before the method you want:

new Thread {
    @SuppressWarnings("all")
    public void run() {
        ShellFolder.get("fileChooserComboBoxFolders"); //No warnings.
    }
}.start();
nasso
  • 603
  • 5
  • 13
0

AFAIK it fetches the file system root directories (Windows: drive letters) without doing anything with them. This may take a while, hence this might be a speed-up, for the slowness of JFileChooser in older java versions. So remove.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138