10 December 2017

Google Drive File Stream: Drive letter changing on Windows (bug + workaround)

Google is replacing Google Drive with Google Drive File Stream (GDFS).
With GDFS you can (finally) cherry pick the folders that are synchronized to your local Drive (default: none).
GDFS mounts all network shares by default to drive G (what did you expect?).
Under G you will find a folder for your personal Drive and another folder for team drives you are member of (new with GDFS).
If the G drive is taken, GDFS takes the H drive and so on...

But...
Every once in a while GDFS mistakenly thinks the G drive is occupied and switches to H, next time it is back on G again... Very annoying if you have an absolute path reference to something on your drive (shortcuts, scripts...). The solution is a classic Windows trick: stop and restart:

  1. Go to your task bar tray, right click the GDFS icon and choose quit
  2. Start Drive File Stream again from the Start Menu.
Users are really annoyed by this bug, so let's hope it's fixed soon.

6 December 2017

Java 9 @Deprecated

That is to say: Java 9 enhances Deprecated.

@Deprecated(forRemoval=true)

The @Deprecated annotation has a new parameter forRemoval (default: false).
If the parameter is true, the item will be removed in a future version, according to javadoc.
This used to be the meaning of Deprecated in the beginning (when it was still a javadoc tag), but Java never actually removed anything marked Deprecated AFAIK.
That is, until Java 9, where some items effectively got pruned, to avoid cyclic dependencies in the new module system (in java.beans.PropertyListener).
Oracle says that, for Java SE, the intend is that something marked with @Deprecated(forRemoval=true) in Java 10, will be gone in Java 11 (ouch).

Suppressing warnings

Deprecation warnings are also impacted.
You can surpress compiler deprecation warnings with @SuppressWarnings(“deprecation”) in your code.
This does not work for imports, but that is a bug that is (finally) solved in Java 9.
On the other hand, In Java 9 the @SuppressWarnings(“deprecation”) will not work for @Deprecatedor(forRemoval=true). And rightfully so, given that people suppress the warnings because they assume nothing is going away any time soon.
 In Java 9, to suppress forRemoval=true warnings, use  @SuppressWarnings(“removal”).
To suppress both forRemoval=false and forRemoval=true, use @SuppressWarnings("deprecation", “removal”).