Lyn-Tech / gstreamer-java

Automatically exported from code.google.com/p/gstreamer-java
0 stars 0 forks source link

Name Clash error from compiler #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm using Netbeans 6.9 IDE, with java version 1.6, on Ubuntu 10.04LTS - and 
downloaded the 1.4 source version of gstreamer-java. 

Netbeans compiler complains in GObject.java, MiniObject.java and GstObject.java 
with the following error message; (each file has similar error for the 
'objectFor' method)

name clash: <T>objectFor(com.sun.jna.Pointer,java.lang.Class<T>) in 
org.gstreamer.GstObject and objectFor(com.sun.jna.Pointer,java.lang.Class<? 
extends org.gstreamer.GObject>) in org.gstreamer.GObject have the same erasure, 
yet neither overrides the other

I have not been able to determine what needs to be "fixed", and not 
particularly an expert on generics. Any help on suggesting a change would be 
appreciated so I can attempt to use this package for our project. 

Please let me know if you need any further information. 

Thank You
\Mike

Original issue reported on code.google.com by mfeldma...@gmail.com on 2 Sep 2010 at 10:24

GoogleCodeExporter commented 8 years ago
is this update fix it?
http://code.google.com/p/gstreamer-java/source/detail?r=400

Original comment by lfar...@gmail.com on 24 Sep 2010 at 11:12

GoogleCodeExporter commented 8 years ago
No - r414 still has the problem. 

The problem is that multiple classes in the same type hierarchy (e.g. 
NativeObject and GstObject) have implemented the objectFor() static method, 
which type-erases to the same method signature, but there is an ambiguous 
mapping of generics at compile time (the "yet neither overrides the other" 
bit). I'm told that it's a bug as per the Java spec so NetBeans correctly 
rejects it, even though javac allows it.

The simple solution is to delete the objectFor() methods in the superclasses 
such as GstObject, MiniObject, etc. I've done this for r414 - see attached 
patch.

Original comment by naskies@gmail.com on 13 Oct 2010 at 2:58

Attachments:

GoogleCodeExporter commented 8 years ago
fixed by another patch in head.

Original comment by lfar...@gmail.com on 19 Oct 2010 at 2:11

GoogleCodeExporter commented 8 years ago
I just checked out r435 from the trunk but it doesn't appear to be fixed - same 
errors in NetBeans 6.9.1.

Original comment by naskies@gmail.com on 25 Oct 2010 at 2:15

GoogleCodeExporter commented 8 years ago
r436

Original comment by vitorl...@gmail.com on 25 Oct 2010 at 10:16