[PUSHED] Re: [PATCH] cleanup java code and update to Java5, including generics (36)

Michael Stahl mstahl at redhat.com
Fri Jun 29 13:07:58 PDT 2012


On 29/06/12 11:03, Noel Grandin wrote:
> Hi
> 
> This patch series primarily updates our java code to use the new
> features in Java5, which means generics.
> Along the way I also cleaned up some javadoc warnings, and a few other
> things.
> 
> After this patch, "make check" no longer generates any warnings from the
> java compiler about "unchecked conversions".
> 
> Because of the size of this patch series (3MB total), I have pushed the
> files via YouSendIt links.

downloading 36 patches from there was no fun at all, please upload a
tarball next time, or use gerrit (do you have an account already?).

the patch "Java cleanup - remove unused local variables" does some silly
things like

> -        Short aShort = new Short((short) 1);
> +        new Short((short) 1);

but i guess it's difficult to automate removal of that, because the
methods called could have side effects, or (in the unit tests) the
called method is one of the methods that should be tested, so by calling
it we know it doesn't crash.

[PATCH 22/36] Java5 update - convert code to use generics
[PATCH 36/36] Java5 updates - update code to use generics

the above 2 patches seem to change interfaces of classes in "ridljar"
and "javaunohelper" that are likely part of the stable URE ABI, and
shouldn't be changed; i think adding type parameters is OK (after all
the Java standard libraries had these retrofitted as well, and they
don't exist at runtime anyway thanks to type erasure) but things like
replacing Hashtable with Map is not OK, so i've reverted those parts.

after applying the patches my javac 1.7.0 produced still some warnings
like this, which i've fixed:

> /work/lo/master/wizards/com/sun/star/wizards/common/JavaTools.java:455: warning: unreachable catch clause
>         catch (IOException e)
>         ^
>   thrown type MalformedURLException has already been caught

now there are some deprecation things left that javac doesn't want to
show unless given some -Xlint parameter.

but this is clearly an enormous improvement in terms of annoying warning
output, thanks a lot, pushed to master.



More information about the LibreOffice mailing list