When I try to compile the trunk I get the following error:
/mapsforge-read-only/mapsforge/src/org/mapsforge/preprocessing/routing/highwayHierarchies/DijkstraAlgorithm.java:61:
incompatible types; no instance(s) of type variable(s) S,T exist so
that org.mapsforge.preprocessing.routing.highwayHierarchies.util.prioQueue.BinaryMinHeap<S,T>
conforms to org.mapsforge.preprocessing.routing.highwayHierarchies.util.prioQueue.BinaryMinHeap<org.mapsforge.preprocessing.routing.highwayHierarchies.DijkstraAlgorithm.DijkstraDistanceVertex,java.lang.Integer>
found : <S,T>org.mapsforge.preprocessing.routing.highwayHierarchies.util.prioQueue.BinaryMinHeap<S,T>
required: org.mapsforge.preprocessing.routing.highwayHierarchies.util.prioQueue.BinaryMinHeap<org.mapsforge.preprocessing.routing.highwayHierarchies.DijkstraAlgorithm.DijkstraDistanceVertex,java.lang.Integer>
BinaryMinHeap<DijkstraDistanceVertex, Integer> queue = getQueue();
^
Is this supposed to compile? Is there something wrong with my compiler?
How do I compile only the parts needed in an Android Application?
Is it really necessary to use Eclipse to compile the mapsforge library?
Would it help you if I provided a maven pom-file that can be used to
build the library?
Regards,
Dirk Jäckel
> Is this supposed to compile?
Yes. Actually, we have a project policy (see
http://code.google.com/p/mapsforge/wiki/ProjectConventions) to only
committ code to the repository that compiles. So whenever a build error
occurs, we try to fix that ASAP.
> Is there something wrong with my compiler?
Maybe. I use Eclipse, checkout the mapsforge project and it builds like
a charm. When i manually trigger a rebuild everything works again. No
error at all.
> Is it really necessary to use Eclipse to compile the mapsforge
> library?
It should be possible to compile the code without Eclipse as well
(though i have never tried it). After all, it's ordinary Java code.
> Would it help you if I provided a maven pom-file that can be used to
> build the library?
We use Ant to build our JAR files and i would prefer to use only one
building system if possible. Can you provide an Ant target that does
what you want? We could then add this to our official build script.
Greetings,
Thilo
Found his problem which might match yours :
http://www.olivergierke.de/wordpress/2008/12/javac-issues-implementing-generics/
my setup is java 1.6.0_21-b07 with eclipse Helios Release (where
compiling works)
regards,
frank
I think you are right. My problem seems to be a javac bug.
When I use the eclipse compiler Version 1.8.1 (without the Eclipse
IDE) with maven I get the following warnings/errors:
[INFO] Compilation failure
org.mapsforge.server.poi.persistence.AbstractPerstPersistenceManager:[52,1862]
Type safety: Unchecked cast from Object to T
org/mapsforge/android/map/RouteOverlay.java:[92,0] Type mismatch:
cannot convert from Object to double[][]
org.mapsforge.preprocessing.routing.blockedHighwayHierarchies.Evaluation:[49,1860]
The field Evaluation.kCenterAverageVerticesPerCluster is never read
locally
org.mapsforge.server.poi.persistence.IPoiQuery:[21,792] The import
org.mapsforge.android.map.GeoPoint is never used
org.mapsforge.server.poi.persistence.IPoiQuery:[23,878] The import
org.mapsforge.server.poi.PoiCategory is never used
org.mapsforge.server.poi.persistence.AbstractHilbertRtreePage:[71,2138]
Type safety: Unchecked cast from Object to T
org.mapsforge.server.poi.persistence.AbstractHilbertRtreePage:[76,2291]
Type safety: Unchecked cast from Object to
AbstractHilbertRtreePage<T,S>
org.mapsforge.server.poi.persistence.AbstractHilbertRtreePage:[301,8507]
Type safety: Unchecked cast from Object to E
org.mapsforge.server.poi.persistence.AbstractHilbertRtreePage:[426,12331]
Type safety: Unchecked cast from Object to
AbstractHilbertRtreePage<T,S>
org.mapsforge.preprocessing.routing.highwayHierarchies.util.Serializer:[77,2335]
Type safety: Unchecked cast from Object to S
I am not quite sure which are really errors and which are only
warnings. Don't you get some of those in Eclipse too?
Regards,
Dirk
It seems that error was from an old revision of mapsforge. I am now at
the HEAD, and the errors are gone.
Regards,
Dirk