Bug 103315 - IllegalArgumentException creating method with double-array return type via IType.createMethod()
Summary: IllegalArgumentException creating method with double-array return type via IT...
Status: RESOLVED DUPLICATE of bug 99982
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-11 09:51 EDT by Boris Blajer CLA
Modified: 2005-07-11 12:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Blajer CLA 2005-07-11 09:51:21 EDT
Eclipse 3.1 M7. The following unit-test fails while creating the method: 
	public void testJDTFailure() throws Exception {
		IPackageFragment fragment = 
myJavaProject.getPackageFragmentRoots()[0].createPackageFragment("cz.fff", 
false, null);
		ICompilationUnit unit = fragment.createCompilationUnit
("A.java", "package cz.fff;\npublic abstract class A {}\n", false, null);
		unit.getTypes()[0].createMethod("/**\n * @return \n */\npublic 
abstract boolean[][] getPrimitiveSuperArray();", null, false, null);
	}

Exception is:
java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2583)
	at org.eclipse.jdt.core.dom.ASTConverter.convertType
(ASTConverter.java:2963)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:466)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:879)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTForKind
(ASTParser.java:949)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST
(ASTParser.java:716)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:570)
	at 
org.eclipse.jdt.internal.core.CreateTypeMemberOperation.generateElementAST
(CreateTypeMemberOperation.java:86)
	at 
org.eclipse.jdt.internal.core.CreateMethodOperation.generateElementAST
(CreateMethodOperation.java:78)
	at org.eclipse.jdt.internal.core.CreateTypeMemberOperation.verify
(CreateTypeMemberOperation.java:200)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation
(JavaModelOperation.java:771)
	at org.eclipse.jdt.internal.core.SourceType.createMethod
(SourceType.java:142)
	at cz.blajer.test.TestJDTFailure.testJDTFailure(TestJDTFailure.java:43)
..............

Tested with boolean[][] and String[][] return types, none works.
At the same time, such a method can be added via UI (e.g., by implementing an 
interface which has such a method, and invoking code-sense to create an 
overriding declaration).
Comment 1 Olivier Thomann CLA 2005-07-11 12:06:56 EDT
Could not reproduce with 3.1.
Closing as duplicate of bug 99982.

*** This bug has been marked as a duplicate of 99982 ***