History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17807
Type: Bug Bug
Status: Open Open
Assignee: Alexey Kudravtsev
Reporter: Mark Vedder
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Constructor Generator creates code with mismatched parameter names for generic classes

Created: 17 Apr 08 23:57   Updated: 18 Apr 08 12:45
Component/s: Editor. Code Completion

Build: 7,782
Severity: Low


 Description  « Hide
Given a class that uses generics that extends a class that use generics, and takes the generic type in a constructor, if you use the constructor generator to override the superclass' constructor, a mismatch in the parameter name occurs if the javadoc are copied. The parameter name in the javadoc does not match the parameter name in the parameter list in the signature. This is apparently because IDEA is prefixing the generic type to the parameter object's name. For example, if you start with:
public class CustomFutureTask<V> extends FutureTask<V>
{
	
}

and then override the super class' constructor (via ctrl+O or alt+insert) and "Copy JavaDoc" is selected, the resultant code is:

public class CustomFutureTask<V> extends FutureTask<V>
{
	/**
	 * Creates a <tt>FutureTask</tt> that will upon running, execute the
	 * given <tt>Callable</tt>.
	 *
	 * @param callable the callable task
	 *
	 * @throws NullPointerException if callable is null
	 */
	public CustomFutureTask(Callable<V> vCallable)
	{
		super(vCallable);
	}
}

Notice in the constructor's signature the parameter is named 'vCallable', but in the JavaDoc the @param tag shows 'callable'.

I have not tried this on a method to see if the same thing would happen there.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.