Foros de discusión

RE: Deploy portal src 6.0.5 compiler Exception

thumbnail
Luca Preziati, modificado hace 13 años.

Deploy portal src 6.0.5 compiler Exception

Regular Member Mensajes: 120 Fecha de incorporación: 9/02/09 Mensajes recientes
I get this compiler exception:

55: reference to addAll is ambiguous, both method addAll(java.util.Collection<? extends E>) in java.util.Collection<capture#116 of ? super E> and method addAll(java.util.Collection<? extends E>) in java.util.List<capture#116 of ? super E> match copy.addAll(master);

How solve?
thumbnail
Luca Preziati, modificado hace 13 años.

RE: Deploy portal src 6.0.5

Regular Member Mensajes: 120 Fecha de incorporación: 9/02/09 Mensajes recientes
I have solved casting the list and the method from:

public static <E> void copy(List<E> master, List<? super E> copy) {
if ((master == null) || (copy == null)) {
return;
}

copy.clear();

copy.addAll(master);
}


become:

public static <E> void copy(List<E> master, List<? super E> copy) {
if ((master == null) || (copy == null)) {
return;
}

copy.clear();

((List<E>)copy).addAll(master);
}
thumbnail
Nguyen Trung Kien, modificado hace 13 años.

RE: Deploy portal src 6.0.5

New Member Mensajes: 9 Fecha de incorporación: 29/06/09 Mensajes recientes
Thank Luca, I get this error when deploy liferay portal 6.05...
It is bug,isn't it?
Liferay will fix it in next edition?
thumbnail
Hitoshi Ozawa, modificado hace 13 años.

RE: Deploy portal src 6.0.5 compiler Exception

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
I've build and deployed Liferay 6.0.5 source without any problem. Where have to obtained your source?
thumbnail
Amos Fong, modificado hace 13 años.

RE: Deploy portal src 6.0.5 compiler Exception

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
What version of java are you using?
thumbnail
Hitoshi Ozawa, modificado hace 13 años.

RE: Deploy portal src 6.0.5 compiler Exception

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
And of course, if you have created your build.{user name}.properties files.
thumbnail
Roman Hoyenko, modificado hace 13 años.

RE: Deploy portal src 6.0.5 compiler Exception

Liferay Master Mensajes: 878 Fecha de incorporación: 8/10/07 Mensajes recientes
I have the same problem with 6.0.6. I am using java 1.6

I changed build.properties to have

ant.build.javac.source=1.6
ant.build.javac.target=1.6

that's the only change.

The problem is in
liferay-portal-src-6.0.6\portal-service\src\com\liferay\portal\kernel\util\ListUtil.java

we import

import java.util.List;
import java.util.Collection;

and they both have addAll method, so when we call

copy.addAll(master);

it doesn't know which method to call.
thumbnail
Hitoshi Ozawa, modificado hace 13 años.

RE: Deploy portal src 6.0.5 compiler Exception

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
ant.build.javac.source=1.5
ant.build.javac.target=1.5


I'm using JDK 1.6 but have set the ant.build.javac=1.5
Solo Imr, modificado hace 12 años.

RE: Deploy portal src 6.0.5 compiler Exception

Junior Member Mensajes: 38 Fecha de incorporación: 9/10/08 Mensajes recientes
I have the same problen with 6.0.6 ( liferay-portal-src-6.0.6-20110225.zip )
I have the same configuration that Hitoshi Ozawa ( I'm using JDK 1.6 but have set the ant.build.javac=1.5 )