[
https://issues.apache.org/jira/browse/SANDBOX-404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226818#comment-13226818
]
Claudio Squarcella commented on SANDBOX-404:
--------------------------------------------
Hi,
I found it. All the above errors were caused by the tests using null weight
operations, while the compiler expects an explicit type. So as a workaround I
just added casts to existing types: see the example below.
Before:
{code}
findShortestPath( graph ).from( a ).to( b ).applyingDijkstra( null );
{code}
After:
{code}
findShortestPath( graph ).from( a ).to( b ).applyingDijkstra(
(DoubleWeightBaseOperations) null );
{code}
Now, secondary issue: while looking for a solution I also noticed that
{{SpanningTree}} did not have a generic type for the type of weight operations
(i.e. the variable in {{MutableSpanningTree}} had explicit type {{Monoid<W>}}).
So as a first attempt to fix the error I added {{WO}} as a generic type in
{{SpanningTree}} and modified all the classes using it.
Is it ok if I commit both changes together? (and since we're here, I can also
do the same for {{InMemoryWeightedPath}} that still uses {{Monoid<W>}}).
Claudio
> Simplify weight model
> ---------------------
>
> Key: SANDBOX-404
> URL: https://issues.apache.org/jira/browse/SANDBOX-404
> Project: Commons Sandbox
> Issue Type: Improvement
> Components: Graph
> Reporter: Simone Tripodi
> Attachments: SANDBOX-404.patch,
> SANDBOX-404_FromMonoidToAddition.patch,
> SANDBOX-404_gettingRidOfOrderedMonoid.patch
>
>
> As discussed on {{dev@}}, {{Zero}}, {{Semigroup}} and {{Monoid}} can be
> merged directly in one single interface
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira