I have done a rebuild [1] of Java packages using Java 8. About 20 % of packages currently fail, but mostly for reasons not related directly to Java 8.
Some of problems I have found:
1) Some collection iterators return elements in different order - most common problem, which breaks tests in many packages and who knows what else.
Solution: work with upstream to fix buggy code that relies on order of elements in unordered collections.
2) Assertion failure jn javadoc - rhbz#1082186
3) Some new methods were added, which breaks existing code. Examples: java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
4) java.lang.reflect.Proxy - fields of proxy classes cannot be accessed using reflection any longer?
[1] The rebuild was done for testing purposes only. Resulting Builds are not included in Fedora.
On 04/02/2014 01:37 PM, Andrew Haley wrote:
On 04/02/2014 12:20 PM, Mikolaj Izdebski wrote:
- java.lang.reflect.Proxy - fields of proxy classes cannot be accessed
using reflection any longer?
I'd like to see a case of this.
I'll try to get more details if I find the build log which showed this problem.
On 04/02/2014 01:37 PM, Andrew Haley wrote:
On 04/02/2014 12:20 PM, Mikolaj Izdebski wrote:
- java.lang.reflect.Proxy - fields of proxy classes cannot be accessed
using reflection any longer?
I'd like to see a case of this.
Now I've noticed that the proxy class is in some strange package, so I don't know exactly what's going on here. But the error is:
java.lang.IllegalAccessException: Class org.hibernate.annotations.common.annotationfactory.AnnotationFactory can not access a member of class org.hibernate.annotations.common.test.annotationfactory.$Proxy2 with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:101) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:295) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:287) at java.lang.reflect.Constructor.newInstance(Constructor.java:398) at org.hibernate.annotations.common.annotationfactory.AnnotationFactory.getProxyInstance(AnnotationFactory.java:63) at org.hibernate.annotations.common.annotationfactory.AnnotationFactory.create(AnnotationFactory.java:49) at org.hibernate.annotations.common.test.annotationfactory.AnnotationFactoryTest.testCreatesProxyInstancesOfAnnotations(AnnotationFactoryTest.java:33)
Package: hibernate-commons-annotations
* Mikolaj Izdebski mizdebsk@redhat.com [2014-04-02 07:21]:
I have done a rebuild [1] of Java packages using Java 8. About 20 % of packages currently fail, but mostly for reasons not related directly to Java 8.
Some of problems I have found:
- Some collection iterators return elements in different order - most
common problem, which breaks tests in many packages and who knows what else.
Solution: work with upstream to fix buggy code that relies on order of elements in unordered collections.
Assertion failure jn javadoc - rhbz#1082186
Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Deepak
- java.lang.reflect.Proxy - fields of proxy classes cannot be accessed
using reflection any longer?
[1] The rebuild was done for testing purposes only. Resulting Builds are not included in Fedora.
-- Mikolaj Izdebski Software Engineer, Red Hat IRC: mizdebsk -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
* Deepak Bhole dbhole@redhat.com [2014-04-02 14:16]:
- Mikolaj Izdebski mizdebsk@redhat.com [2014-04-02 07:21]:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator)
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
ini4j runs into this problem. I filed the bug with the error message: https://sourceforge.net/p/ini4j/bugs/47/
Basically, a class implements the java.util.Map interface and has a method. With Java 8, java.util.Map gained a method with the same name but a different return type. Now javac wont compile the class because the implemented method is incompatible with the signature of the new method in java.util.Map.
I don't see an obvious fix for this, at least for ini4j.
Thanks, Omair
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Package: eclipse-dltk
On 04/04/2014 01:23 PM, Mikolaj Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Or another example:
[javac] /builddir/build/BUILD/jdom-JDOM-2.0.5/core/src/java/org/jdom2/ContentList.java:1241: error: sort(Comparator<? super F>) in ContentList.FilterList cannot implement sort(Comparator<? super E>) in List [javac] final void sort(final Comparator<? super F> comp) { [javac] ^ [javac] attempting to assign weaker access privileges; was public [javac] where F,E are type-variables: [javac] F extends Content declared in class ContentList.FilterList [javac] E extends Object declared in interface List
Package: jdom2
* Mikolaj Izdebski mizdebsk@redhat.com [2014-04-04 07:30]:
On 04/04/2014 01:23 PM, Mikolaj Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Or another example:
[javac]
/builddir/build/BUILD/jdom-JDOM-2.0.5/core/src/java/org/jdom2/ContentList.java:1241: error: sort(Comparator<? super F>) in ContentList.FilterList cannot implement sort(Comparator<? super E>) in List [javac] final void sort(final Comparator<? super F> comp) { [javac] ^ [javac] attempting to assign weaker access privileges; was public [javac] where F,E are type-variables: [javac] F extends Content declared in class ContentList.FilterList [javac] E extends Object declared in interface List
Package: jdom2
Ah, that is unfortunate. Both this and ini4j will require upstream fixes for this one :/
Deepak
-- Mikolaj Izdebski Software Engineer, Red Hat IRC: mizdebsk -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
Il 04/04/2014 13:30, Mikolaj Izdebski ha scritto:
On 04/04/2014 01:23 PM, Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples: java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Or another example:
[javac]
/builddir/build/BUILD/jdom-JDOM-2.0.5/core/src/java/org/jdom2/ContentList.java:1241: error: sort(Comparator<? super F>) in ContentList.FilterList cannot implement sort(Comparator<? super E>) in List [javac] final void sort(final Comparator<? super F> comp) { [javac] ^ [javac] attempting to assign weaker access privileges; was public [javac] where F,E are type-variables: [javac] F extends Content declared in class ContentList.FilterList [javac] E extends Object declared in interface List
Package: jdom2
hi solved jdom2 problems thanks to Mikolaj and jdom developers Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=6708879 regards gil
On 04/04/2014 05:23 AM, Mikolaj Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Package: eclipse-dltk
Seeing similar with eclipse-photran:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile) on project org.eclipse.photran.core.vpg: Compilation failure: Compilation failure: [ERROR] /builddir/build/BUILD/org.eclipse.photran-5313e0561fbb3d888ecf1817c6101a36e0b89a07/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/IASTListNode.java:[17] [ERROR] public interface IASTListNode<T> extends List<T>, IASTNode [ERROR] ^^^^^^^^^^^^ [ERROR] Duplicate methods named spliterator with the parameters () and () are inherited from the types List<T> and Collection<T>
Is there a generic fix for this type of error?
On 04/07/2014 12:17 PM, Orion Poplawski wrote:
On 04/04/2014 05:23 AM, Mikolaj Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Package: eclipse-dltk
Seeing similar with eclipse-photran:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile) on project org.eclipse.photran.core.vpg: Compilation failure: Compilation failure: [ERROR] /builddir/build/BUILD/org.eclipse.photran-5313e0561fbb3d888ecf1817c6101a36e0b89a07/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/IASTListNode.java:[17] [ERROR] public interface IASTListNode<T> extends List<T>, IASTNode [ERROR] ^^^^^^^^^^^^ [ERROR] Duplicate methods named spliterator with the parameters () and () are inherited from the types List<T> and Collection<T>
Is there a generic fix for this type of error?
Is this needed in Fedora?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=409473
----- Original Message -----
From: "Orion Poplawski" orion@cora.nwra.com To: "Mikolaj Izdebski" mizdebsk@redhat.com, "Fedora Java Development List" java-devel@lists.fedoraproject.org Sent: Monday, April 7, 2014 10:19:04 PM Subject: Re: [fedora-java] Java 8 testing in Fedora
On 04/07/2014 12:17 PM, Orion Poplawski wrote:
On 04/04/2014 05:23 AM, Mikolaj Izdebski wrote:
On 04/02/2014 08:16 PM, Deepak Bhole wrote:
- Some new methods were added, which breaks existing code. Examples:
java.util.Map - remove(K,V) java.util.List - sort(Comparator) java.lang.reflect.TypeVariable - getAnnotatedBounds() sun.security.jgss.spi.GSSCredentialSpi - impersonate(GSSNameSpi)
Solution: patch code to implement new methods
The java.util* ones use the new default mechanism and should pose no problem afaik. Can you post a snippet of the error message?
The last 2 will require code changes to accommodate those methods. Thankfully there should be far fewer cases of those than the first 2.
Duplicate methods named spliterator with the parameters () and () are inherited from the types Collection<LazyExtensionManager.Descriptor<E>> and Iterable<LazyExtensionManager.Descriptor<E>>
Package: eclipse-dltk
Seeing similar with eclipse-photran:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile) on project org.eclipse.photran.core.vpg: Compilation failure: Compilation failure: [ERROR] /builddir/build/BUILD/org.eclipse.photran-5313e0561fbb3d888ecf1817c6101a36e0b89a07/org.eclipse.photran.core.vpg/parser/org/eclipse/photran/internal/core/parser/IASTListNode.java:[17] [ERROR] public interface IASTListNode<T> extends List<T>, IASTNode [ERROR] ^^^^^^^^^^^^ [ERROR] Duplicate methods named spliterator with the parameters () and () are inherited from the types List<T> and Collection<T>
Is there a generic fix for this type of error?
Is this needed in Fedora?
What you look for is https://bugs.eclipse.org/bugs/show_bug.cgi?id=390889 . It's WIP and should enter fedora in a week or two mostly.
Alexander Kurtakov Red Hat Eclipse team
-- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA/CoRA Division FAX: 303-415-9702 3380 Mitchell Lane orion@cora.nwra.com Boulder, CO 80301 http://www.cora.nwra.com -- java-devel mailing list java-devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/java-devel
Another problem: Annotation processing too (apt) was removed.
On Thu, 2014-04-03 at 17:52 +0200, Mikolaj Izdebski wrote:
Another problem: Annotation processing too (apt) was removed.
[1] has some info on this. Plus what can/should be used instead.
Cheers, Severin
[1] http://docs.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.htm...
Java 8 is stricter regarding Generics and casting. I had one issue with "avro" in rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1082417
java-devel@lists.fedoraproject.org