[Bluej-discuss] Problem with generic types on the workbench

Davin McCall davmac at bluej.org
Fri Apr 28 15:44:07 BST 2006


jpagliar at sunyrockland.edu wrote:

> I've been working with generic types in Java and I've come across an
> interesting problem.
> This occurred when I was actually working on a linked implementation of
> binary trees, but I've traced it back to simpler forms of generics with a
> linked list.
>
> Here's the code:
>   

Unfortunately this seems to be a BlueJ bug, present in (at least) 2.1.2 
and 2.1.3. It used to work in 2.0.5.

It looks as if the bug will affect any constructor invocation for a 
class with a type parameter which also appears as a type parameter in 
one of the constructor parameter types (what a mouthful). In your case 
it is the "Node<T>" parameter that is causing the problem.

It's a shame we didn't catch this in time for the 2.1.3 release. Thanks 
for reporting it. As a workaround, you can use the codepad to perform 
this type of construction.

Davin




More information about the bluej-discuss mailing list