You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simone Tripodi (Created) (JIRA)" <ji...@apache.org> on 2012/02/06 15:09:59 UTC

[jira] [Created] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Generic Type inference doesn't work in Eclipse
----------------------------------------------

                 Key: SANDBOX-388
                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
             Project: Commons Sandbox
          Issue Type: Bug
          Components: Graph
         Environment: Eclipse Java EE IDE for Web Developers.

Version: Indigo Service Release 1
Build id: 20110916-0149
            Reporter: Simone Tripodi
            Priority: Blocker


{{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.

One of the reported error in Eclipse is:

{quote}
Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
{quote}

Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Matt Benson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202340#comment-13202340 ] 

Matt Benson commented on SANDBOX-388:
-------------------------------------

Yes, I figured that must be the case.  :)
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>         Attachments: sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201478#comment-13201478 ] 

Simone Tripodi commented on SANDBOX-388:
----------------------------------------

the problem is that for {{findMaxFlow()}} method it never infers the {{W}} type, even with valid graph :(
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Issue Comment Edited] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Steven Dolg (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201572#comment-13201572 ] 

Steven Dolg edited comment on SANDBOX-388 at 2/6/12 8:55 PM:
-------------------------------------------------------------

A quick workaround might be overloading the methods in question, using a type of graph that allows to connect the disobedient generic to Graph in the type parameters of the method header.

Like this:
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedMutableWeightedGraph<V, WE, W>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedGraph<V, WE>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )
{noformat}
and this
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends UndirectedMutableWeightedGraph<V, WE, W>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends Graph<V, WE>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )
{noformat}

This fixes all the compile error in my Eclipse (exact same version as mentioned in the issue description).
Not sure if this works everywhere or if it is desirable at all, but I wanted to mention it anyway.
                
      was (Author: steven.dolg):
    A quick workaround might be overloading the methods in question, using a type of graph that allows to mention the disobedient generic in the type parameters of the method header.

Like this:
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedMutableWeightedGraph<V, WE, W>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedGraph<V, WE>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )
{noformat}
and this
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends UndirectedMutableWeightedGraph<V, WE, W>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends Graph<V, WE>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )
{noformat}

This fixes all the compile error in my Eclipse (exact same version as mentioned in the issue description).
Not sure if this works everywhere or if it is desirable at all, but I wanted to mention it anyway.
                  
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201299#comment-13201299 ] 

Gary D. Gregory commented on SANDBOX-388:
-----------------------------------------

Did you try the latest Eclipse 3.x AND 4.x?
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201300#comment-13201300 ] 

Gary D. Gregory commented on SANDBOX-388:
-----------------------------------------

Data point: I see this in 3.7.1.
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201346#comment-13201346 ] 

Simone Tripodi commented on SANDBOX-388:
----------------------------------------

Hi Jörg, sorry for the ignorance, but... I don't know how to install Oracle JDK7 on Mac Os X :(
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

       

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Joerg Schaible (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201327#comment-13201327 ] 

Joerg Schaible commented on SANDBOX-388:
----------------------------------------

@simo: If it's reported to fail with OraJDK 7, you should use that one with Maven to proof something ... ;-)
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Updated] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Claudio Squarcella (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claudio Squarcella updated SANDBOX-388:
---------------------------------------

    Attachment: SANDBOX-388_FixForGenericTypesInEclipse.patch

Hello Steven (and all),

thank you for sharing your intuition! 
I am attaching a patch that draws on the same idea (re)introducing {{WeightedGraph}} as an interface, to fix the problem at the interface level. 

And yes, [blame me for getting rid of that before|https://issues.apache.org/jira/browse/SANDBOX-344]! :D

Hoping this helps,
Claudio
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>         Attachments: SANDBOX-388_FixForGenericTypesInEclipse.patch, sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Steven Dolg (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201572#comment-13201572 ] 

Steven Dolg commented on SANDBOX-388:
-------------------------------------

A quick workaround might be overloading the methods in question, using a type of graph that allows to mention the disobedient generic in the type parameters of the method header.

Like this:
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedMutableWeightedGraph<V, WE, W>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends DirectedGraph<V, WE>> FromHeadBuilder<V, WE, W, G> findMaxFlow( G graph )
{noformat}
and this
{noformat}
    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends UndirectedMutableWeightedGraph<V, WE, W>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )

    public static <V extends Vertex, WE extends WeightedEdge<W>, W, G extends Graph<V, WE>> SpanningTreeSourceSelector<V, W, WE, G> minimumSpanningTree( G graph )
{noformat}

This fixes all the compile error in my Eclipse (exact same version as mentioned in the issue description).
Not sure if this works everywhere or if it is desirable at all, but I wanted to mention it anyway.
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201320#comment-13201320 ] 

Simone Tripodi commented on SANDBOX-388:
----------------------------------------

what worries me is that Eclipse users would be reluctant on using our APIs because of that issue... ;(
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Resolved] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi resolved SANDBOX-388.
------------------------------------

    Resolution: Fixed
      Assignee: Simone Tripodi

You guys made me the happiest man in the world today, Thanks Steven & Claudio!!!

I applied Claudio's patch that provides a more abstracted APIs, but *thank you* Steven for the intuition!!!

Fixed on [r1241491|http://svn.apache.org/viewvc?rev=1241491&view=rev], all the best!
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Assignee: Simone Tripodi
>            Priority: Blocker
>         Attachments: SANDBOX-388_FixForGenericTypesInEclipse.patch, sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201616#comment-13201616 ] 

Simone Tripodi commented on SANDBOX-388:
----------------------------------------

Hi Steven!!

simply amazing!!! Since you are an ASF committer, would you be pleased to be granted to commit to Sandbox? Commons Sandbox is open to all ASF committers, I would be more than glad if you could participate!

Many thanks in advance!
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Thomas Neidhart (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201384#comment-13201384 ] 

Thomas Neidhart commented on SANDBOX-388:
-----------------------------------------

A rather ugly but working solution would be to cast the input graph to an unchecked DirectedGraph to circumvent type inference at all, like the following:

{code:title=FordFulkersonTest.java|borderStyle=solid}
@Test(expected=NullPointerException.class)
public void testNullGraphAndVertices()
{
  findMaxFlow( (DirectedGraph) null ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeight() );
}
{code} 
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Updated] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Steven Dolg (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Dolg updated SANDBOX-388:
--------------------------------

    Attachment: sandbox-388.txt

Sure, you can hook me up and I will commit myself. Just don't expect a lot of commits from me. I'm just here for the puzzles... :P

In the meantime here's a patch containing all the changes.

Overloading is working because the upper bound of G is changed. This leads to a different erasure, which is created by replacing the generic parameter with its upper bound. So those really are two different method signatures.
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>         Attachments: sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Simone Tripodi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201304#comment-13201304 ] 

Simone Tripodi commented on SANDBOX-388:
----------------------------------------

what is driving me crazy is that running from CLI

{quote}
$ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /Applications/apache-maven-3.0.4
Java version: 1.6.0_29, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.2", arch: "x86_64", family: "mac"
{quote}

doesn't report the same error :(
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Steven Dolg (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202652#comment-13202652 ] 

Steven Dolg commented on SANDBOX-388:
-------------------------------------

That looks very nice; a method asking for WeightedEdges on a WeightedGraph.
I couldn't quite put my finger on it, but now it seems obvious that it was simply this type of balance that was missing.

Well done!
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Assignee: Simone Tripodi
>            Priority: Blocker
>         Attachments: SANDBOX-388_FixForGenericTypesInEclipse.patch, sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201314#comment-13201314 ] 

Gary D. Gregory commented on SANDBOX-388:
-----------------------------------------

Don't go bonkers Simo, Eclipse has its own Java compiler.
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Gary D. Gregory (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202680#comment-13202680 ] 

Gary D. Gregory commented on SANDBOX-388:
-----------------------------------------

No more errors in Eclipse! Thank you!
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Assignee: Simone Tripodi
>            Priority: Blocker
>         Attachments: SANDBOX-388_FixForGenericTypesInEclipse.patch, sandbox-388.txt
>
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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

        

[jira] [Commented] (SANDBOX-388) Generic Type inference doesn't work in Eclipse

Posted by "Matt Benson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANDBOX-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13202051#comment-13202051 ] 

Matt Benson commented on SANDBOX-388:
-------------------------------------

Yes; all I can say is "holy shit."  :)  I thought certainly type erasure would have made these two methods identical and thus illegal, but yes, it does seem to work here.  Great catch, Steven!
                
> Generic Type inference doesn't work in Eclipse
> ----------------------------------------------
>
>                 Key: SANDBOX-388
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-388
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>         Environment: Eclipse Java EE IDE for Web Developers.
> Version: Indigo Service Release 1
> Build id: 20110916-0149
>            Reporter: Simone Tripodi
>            Priority: Blocker
>
> {{Flow}} and {{MST}} EDSL is affected by generic type inference issue, it simply doesn't work in Eclipse. It works in IDEA, but in the Eclipse forum they reported that doesn't work if the code is compiled with Oracle JDK7.
> One of the reported error in Eclipse is:
> {quote}
> Type mismatch: cannot convert from SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Object> to SpanningTree<BaseLabeledVertex,BaseLabeledWeightedEdge<Double>,Double>
> {quote}
> Looking for a solution

--
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