[280568] Null Pointer Exception while copying Javascript source
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
index 152f5fd..dfb9462 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
@@ -2690,7 +2690,6 @@
assertTrue(((PrimitiveType) x.getReturnType()).getPrimitiveTypeCode() == PrimitiveType.VOID);
} else {
assertTrue(x.modifiers().size() == 0);
- assertTrue(x.typeParameters().size() == 0);
assertTrue(x.getReturnType2().getParent() == x);
assertTrue(x.getReturnType2().isPrimitiveType());
assertTrue(((PrimitiveType) x.getReturnType2()).getPrimitiveTypeCode() == PrimitiveType.VOID);
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
index ab3ce87..152b42c 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
@@ -182,63 +182,6 @@
assertEqualString(preview, buf.toString());
}
- public void testMethodTypeParameterRemoves() throws Exception {
- IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
- StringBuffer buf= new StringBuffer();
- buf.append("package test1;\n");
- buf.append("public abstract class E {\n");
- buf.append(" /**\n");
- buf.append(" *\n");
- buf.append(" */\n");
- buf.append(" <X> E(int p1) {}\n");
- buf.append(" <X> E(int p1, int p2) {}\n");
- buf.append(" public <X> E(int p1, byte p2) {}\n");
- buf.append(" /**\n");
- buf.append(" *\n");
- buf.append(" */\n");
- buf.append(" <X> void gee(int p1) {}\n");
- buf.append(" <X> void hee(int p1, int p2) {}\n");
- buf.append(" public <X> void hee(int p1, byte p2) {}\n");
- buf.append(" public<X>void hee(int p1, byte p2) {}\n");
- buf.append("}\n");
- IJavaScriptUnit cu= pack1.createCompilationUnit("E.js", buf.toString(), false, null);
-
- JavaScriptUnit astRoot= createAST3(cu);
- ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
- TypeDeclaration type= findTypeDeclaration(astRoot, "E");
-
- FunctionDeclaration[] methods= type.getMethods();
- for (int i= 0; i < methods.length; i++) {
-
- // add type parameter
- FunctionDeclaration methodDecl= methods[i];
- rewrite.remove((ASTNode) methodDecl.typeParameters().get(0), null);
-
- }
- String preview= evaluateRewrite(cu, rewrite);
-
- buf= new StringBuffer();
- buf.append("package test1;\n");
- buf.append("public abstract class E {\n");
- buf.append(" /**\n");
- buf.append(" *\n");
- buf.append(" */\n");
- buf.append(" E(int p1) {}\n");
- buf.append(" E(int p1, int p2) {}\n");
- buf.append(" public E(int p1, byte p2) {}\n");
- buf.append(" /**\n");
- buf.append(" *\n");
- buf.append(" */\n");
- buf.append(" void gee(int p1) {}\n");
- buf.append(" void hee(int p1, int p2) {}\n");
- buf.append(" public void hee(int p1, byte p2) {}\n");
- buf.append(" public void hee(int p1, byte p2) {}\n");
- buf.append("}\n");
- assertEqualString(preview, buf.toString());
- }
-
-
-
public void testMethodReturnTypeChanges() throws Exception {
IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();