Hello

Since this commit it is not possible anymore to build tomcat 8 with -target
1.7 & -source 1.7 but we have to use 1.8.
Is it really the awaited result? I thought that Tomcat 8 was still jdk 7
compatible as stated in the release notes:
http://tomcat.apache.org/tomcat-8.0-doc/RELEASE-NOTES.txt

Here an error I get with 1.7 (it works without problem with target & source
set to 1.8):

src/main/java/javax/el/ExpressionFactory.java:339: error: incompatible
types: WeakReference<Class<CAP#1>> cannot be converted to
WeakReference<Class<?>>

            ref = new WeakReference<>(clazz);

                  ^

  where CAP#1 is a fresh type-variable:

    CAP#1 extends Object from capture of ?

1 error

Regards,
Pierre



2014-11-03 14:10 GMT+01:00 <[email protected]>:

> Author: markt
> Date: Mon Nov  3 13:10:04 2014
> New Revision: 1636345
>
> URL: http://svn.apache.org/r1636345
> Log:
> Fix IDE warnings after switching to Java 8
>
> Modified:
>     tomcat/trunk/java/javax/el/ExpressionFactory.java
>     tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
>     tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
>
> Modified: tomcat/trunk/java/javax/el/ExpressionFactory.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ExpressionFactory.java?rev=1636345&r1=1636344&r2=1636345&view=diff
>
> ==============================================================================
> --- tomcat/trunk/java/javax/el/ExpressionFactory.java (original)
> +++ tomcat/trunk/java/javax/el/ExpressionFactory.java Mon Nov  3 13:10:04
> 2014
> @@ -336,7 +336,7 @@ public abstract class ExpressionFactory
>          }
>
>          public void setFactoryClass(Class<?> clazz) {
> -            ref = new WeakReference<Class<?>>(clazz);
> +            ref = new WeakReference<>(clazz);
>          }
>      }
>
>
> Modified:
> tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java?rev=1636345&r1=1636344&r2=1636345&view=diff
>
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
> (original)
> +++ tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/PoolingConnection.java
> Mon Nov  3 13:10:04 2014
> @@ -321,23 +321,23 @@ public class PoolingConnection extends D
>                  @SuppressWarnings({"rawtypes", "unchecked"}) // Unable to
> find way to avoid this
>                  PoolablePreparedStatement pps = new
> PoolablePreparedStatement(
>                          getDelegate().prepareStatement(key.getSql()),
> key, _pstmtPool, this);
> -                return new
> DefaultPooledObject<DelegatingPreparedStatement>(pps);
> +                return new DefaultPooledObject<>(pps);
>              }
> -            return new DefaultPooledObject<DelegatingPreparedStatement>(
> +            return new DefaultPooledObject<>(
>                      new
> PoolableCallableStatement(getDelegate().prepareCall( key.getSql()), key,
> _pstmtPool, this));
>          } else if (null == key.getResultSetType() && null ==
> key.getResultSetConcurrency()){
>              @SuppressWarnings({"rawtypes", "unchecked"}) // Unable to
> find way to avoid this
>              PoolablePreparedStatement pps = new PoolablePreparedStatement(
>                      getDelegate().prepareStatement(key.getSql(),
> key.getAutoGeneratedKeys().intValue()), key, _pstmtPool, this);
> -            return new
> DefaultPooledObject<DelegatingPreparedStatement>(pps);
> +            return new DefaultPooledObject<>(pps);
>          } else { // Both _resultSetType and _resultSetConcurrency are
> non-null here (both or neither are set by constructors)
>              if(key.getStmtType() == StatementType.PREPARED_STATEMENT) {
>                  @SuppressWarnings({"rawtypes", "unchecked"}) // Unable to
> find way to avoid this
>                  PoolablePreparedStatement pps = new
> PoolablePreparedStatement(getDelegate().prepareStatement(
>                          key.getSql(),
> key.getResultSetType().intValue(),key.getResultSetConcurrency().intValue()),
> key, _pstmtPool, this);
> -                return new
> DefaultPooledObject<DelegatingPreparedStatement>(pps);
> +                return new DefaultPooledObject<>(pps);
>              }
> -            return new DefaultPooledObject<DelegatingPreparedStatement>(
> +            return new DefaultPooledObject<>(
>                      new PoolableCallableStatement(
> getDelegate().prepareCall(
>
>  key.getSql(),key.getResultSetType().intValue(),
> key.getResultSetConcurrency().intValue()), key, _pstmtPool, this));
>          }
>
> Modified:
> tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java?rev=1636345&r1=1636344&r2=1636345&view=diff
>
> ==============================================================================
> --- tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
> (original)
> +++ tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
> Mon Nov  3 13:10:04 2014
> @@ -390,8 +390,8 @@ public class TestAbstractAjpProcessor ex
>
>          public ReadBodyServlet(boolean callAvailable) {
>              this.callAvailable = callAvailable;
> -            this.availableList = callAvailable ? new ArrayList<Integer>()
> : null;
> -            this.readList = callAvailable ? new ArrayList<Integer>() :
> null;
> +            this.availableList = callAvailable ? new ArrayList<>() : null;
> +            this.readList = callAvailable ? new ArrayList<>() : null;
>          }
>
>          @Override
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to