GitHub user mike-jumper opened a pull request:

    https://github.com/apache/guacamole-client/pull/324

    GUACAMOLE-635: Require Java 1.8 for all Java components except 
guacamole-common.

    As discussed on #319 and on [the dev@ mailing 
list](https://lists.apache.org/thread.html/874edd3a19b0cf0302cbb56f2406f6050cf4296dc31703aa34b30be6@%3Cdev.guacamole.apache.org%3E),
 this change bumps the Java requirement for all Java components to 1.8, with 
the exception of guacamole-common which remains at 1.6.
    
    There is one change here that isn't simply bumping "1.6" to "1.8": the 
addition of the `@SafeVarargs` annotation to the `SimpleDirectory<ObjectType>` 
constructor that accepts a varargs array of `ObjectType`. This is due to a new 
warning regarding "heap pollution" introduced in newer Java compilers.
    
    From [Oracle's documentation on heap 
pollution](https://docs.oracle.com/javase/tutorial/java/generics/nonReifiableVarargsType.html#vulnerabilities):
    
    >
    > ...
    >
    > ## Heap Pollution
    >
    > _Heap pollution_ occurs when a variable of a parameterized type refers to 
an object that is not of that parameterized type. ...
    >
    > ...
    >
    > ## Prevent Warnings from Varargs Methods with Non-Reifiable Formal 
Parameters
    >
    > If you declare a varargs method that has parameters of a parameterized 
type, and you ensure that the body of the method does not throw a 
`ClassCastException` or other similar exception due to improper handling of the 
varargs formal parameter, you can prevent the warning that the compiler 
generates for these kinds of varargs methods by adding the following annotation 
to static and non-constructor method declarations:
    >
    >     @SafeVarargs
    >
    > ...
    >

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mike-jumper/guacamole-client java-version

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/guacamole-client/pull/324.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #324
    
----
commit 1fef6a05e1e9c6a066c88e2e4c8487b08740a75d
Author: Michael Jumper <mjumper@...>
Date:   2018-09-29T19:56:17Z

    GUACAMOLE-635: Require Java 1.8 for all Java components except 
guacamole-common.

commit 182f204c958ab0c188197e403f75e8550bcb8279
Author: Michael Jumper <mjumper@...>
Date:   2018-09-29T20:19:21Z

    GUACAMOLE-635: Heap pollution is not possible within 
SimpleDirectory(ObjectType... objects).
    
    From 
https://docs.oracle.com/javase/tutorial/java/generics/nonReifiableVarargsType.html#vulnerabilities:
    
    "Heap pollution occurs when a variable of a parameterized type refers
    to an object that is not of that parameterized type."
    
    In this case, the parameterized type (ObjectType) and the array of that
    type within this constructor are always used as their formal types.

----


---

Reply via email to