commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SANDBOX-336) [Graph] Duplicate Edge
Date Sat, 02 Jul 2011 07:31:28 GMT

    [ https://issues.apache.org/jira/browse/SANDBOX-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13058992#comment-13058992
] 

Simone Tripodi commented on SANDBOX-336:
----------------------------------------

Yes, clients that wants to automate Graphs generation have to manage/swallow the exceptions
in that case.

{code}
for ( BaseLabeledVertex v1 : g.getVertices() )
{
    for ( BaseLabeledVertex v2 : g.getVertices() )
    {
        if ( !v1.equals( v2 ) )
        {
            try
            {
                g.addEdge( v1, new BaseLabeledEdge( v1 + " -> " + v2 ), v2 );
            }
            catch ( GraphException ge )
            {
                // do nothing
            }
        }
    }
}
{code}

> [Graph] Duplicate Edge  
> ------------------------
>
>                 Key: SANDBOX-336
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-336
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>            Reporter: Marco Speranza
>         Attachments: missingControllAlreadyExistEdge.patch
>
>
> The method  BaseMutableGraph#addEdge does not check if the edge already exists.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message