Permalink
Browse files

[230291] remove dead code

  • Loading branch information...
1 parent b43ecab commit 65065103de91e37b62d6024c23d8cfedc9f1497d pberkland committed May 9, 2008
Showing with 567 additions and 4,368 deletions.
  1. +88 −1,783 ...eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverter15Test.java
  2. +5 −44 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java
  3. +37 −99 ...se.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java
  4. +81 −155 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java
  5. +24 −38 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTNodesCollectorVisitor.java
  6. +92 −1,009 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
  7. +82 −253 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTVisitorTest.java
  8. +51 −38 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BindingsCollectorVisitor.java
  9. +53 −33 ...eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ConverterTestSetup.java
  10. +5 −27 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/SampleASTs.java
  11. +1 −20 ...jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/DefaultJavaElementComparator.java
  12. +0 −8 ....core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SortCompilationUnitElementsTests.java
  13. +23 −498 ...ests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java
  14. +25 −363 ....tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -15,16 +15,14 @@
import junit.framework.Test;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
@@ -35,12 +33,12 @@
import org.eclipse.wst.jsdt.core.dom.CastExpression;
import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.EnumDeclaration;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
@@ -49,11 +47,9 @@
import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ListExpression;
import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
import org.eclipse.wst.jsdt.core.dom.NullLiteral;
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
@@ -98,23 +94,6 @@ private void collectBindings(
}
}
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnnotationTypeDeclaration)
- * @since 3.0
- */
- public void endVisit(AnnotationTypeDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnnotationTypeMemberDeclaration)
- * @since 3.0
- */
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- IFunctionBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
/**
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnonymousClassDeclaration)
@@ -213,24 +192,6 @@ public void endVisit(ConstructorInvocation node) {
}
/**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(EnumConstantDeclaration)
- * @since 3.0
- */
- public void endVisit(EnumConstantDeclaration node) {
- IVariableBinding binding = node.resolveVariable();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(EnumDeclaration)
- * @since 3.0
- */
- public void endVisit(EnumDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
* @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FieldAccess)
*/
public void endVisit(FieldAccess node) {
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.core.tests.dom;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
import java.lang.reflect.Method;
import java.text.NumberFormat;
import java.util.ArrayList;
@@ -22,12 +23,45 @@
import junit.framework.TestSuite;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.compiler.IProblem;
-import org.eclipse.wst.jsdt.core.dom.*;
+import org.eclipse.wst.jsdt.core.dom.AST;
+import org.eclipse.wst.jsdt.core.dom.ASTNode;
+import org.eclipse.wst.jsdt.core.dom.ASTParser;
+import org.eclipse.wst.jsdt.core.dom.ArrayType;
+import org.eclipse.wst.jsdt.core.dom.Block;
+import org.eclipse.wst.jsdt.core.dom.Comment;
+import org.eclipse.wst.jsdt.core.dom.Expression;
+import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
+import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.FunctionRef;
+import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
+import org.eclipse.wst.jsdt.core.dom.IBinding;
+import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
+import org.eclipse.wst.jsdt.core.dom.IfStatement;
+import org.eclipse.wst.jsdt.core.dom.JSdoc;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
+import org.eclipse.wst.jsdt.core.dom.MemberRef;
+import org.eclipse.wst.jsdt.core.dom.Name;
+import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
+import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
+import org.eclipse.wst.jsdt.core.dom.QualifiedName;
+import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
+import org.eclipse.wst.jsdt.core.dom.SimpleName;
+import org.eclipse.wst.jsdt.core.dom.SimpleType;
+import org.eclipse.wst.jsdt.core.dom.Statement;
+import org.eclipse.wst.jsdt.core.dom.TagElement;
+import org.eclipse.wst.jsdt.core.dom.TextElement;
+import org.eclipse.wst.jsdt.core.dom.Type;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
+import org.eclipse.wst.jsdt.core.dom.TypeDeclarationStatement;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper;
public class ASTConverterJavadocTest extends ConverterTestSetup {
@@ -2788,46 +2822,6 @@ public void testBug93880_14e() throws JavaScriptModelException {
}
}
- /**
- * Bug 94150: [javadoc][dom] Extended ranges wrong for method name without return type
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=94150"
- */
- public void testBug94150() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- astLevel = AST.JLS3;
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b94150/Category.js",
- "package javadoc.b94150;\n" +
- "public enum Category {\n" +
- " /**\n" +
- " * history style\n" +
- " * @see Object\n" +
- " */ \n" +
- " HISTORY,\n" +
- "\n" +
- " /**\n" +
- " * war style\n" +
- " */ \n" +
- " WAR;\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = verifyComments(workingCopies[0]);
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Get enum declaration
- ASTNode node = getASTNode(compilUnit, 0);
- assertEquals("Expected enum declaration.", ASTNode.ENUM_DECLARATION, node.getNodeType());
- EnumDeclaration enumDeclaration = (EnumDeclaration) node;
-
- // Verify each enum constant javadoc
- List constants = enumDeclaration.enumConstants();
- int size = constants.size();
- assertEquals("Wrong number of constants", 2, size);
- for (int i=0; i<size; i++) {
- EnumConstantDeclaration constant = (EnumConstantDeclaration) constants.get(i);
- JSdoc docComment = (JSdoc) compilUnit.getCommentList().get(i); // Do not need to verify following statement as we know it's ok as verifyComments did not fail
- assertTrue("Javadoc should be set on first enum constant", docComment == constant.getJavadoc());
- }
- }
- }
/**
* Bug 99507: [javadoc] Infinit loop in DocCommentParser
@@ -3416,60 +3410,4 @@ public void testBug130752c() throws JavaScriptModelException {
}
}
- /**
- * @bug 165525: [comments] ASTParser excludes trailing line comments from extended range of fields in enums
- * @test Ensure that extended ranges are correct for enum constants and last comments of enum declaration
- * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=165525"
- */
- public void testBug165525() throws JavaScriptModelException {
- workingCopies = new IJavaScriptUnit[1];
- workingCopies[0] = getWorkingCopy("/Converter15/src/javadoc/b165525/Test.js",
- "package javadoc.b165525;\n" +
- "public enum Test {\n" +
- " ENUM_CONST_1(\"String constant 1\") //$NON-NLS-1$\n" +
- " , ENUM_CONST_2(\"String constant 2\") //$NON-NLS-1$\n" +
- " ;\n" +
- " Test(String x) {\n" +
- " }\n" +
- " String a = \"a\"; //$NON-NLS-1$\n" +
- " String b = \"b\"; //$NON-NLS-1$\n" +
- "}\n"
- );
- JavaScriptUnit compilUnit = (JavaScriptUnit) runConversion(AST.JLS3, workingCopies[0], true);
- verifyWorkingCopiesComments();
- if (docCommentSupport.equals(JavaScriptCore.ENABLED)) {
- // Verify comment type
- List unitComments = compilUnit.getCommentList();
- assertEquals("Wrong number of comments", 4, unitComments.size());
-
- // Verify extension of first enum declaration constant
- Comment comment = (Comment) unitComments.get(0);
- EnumDeclaration enumDeclaration = (EnumDeclaration) compilUnit.types().get(0);
- EnumConstantDeclaration constantDeclaration = (EnumConstantDeclaration) enumDeclaration.enumConstants().get(0);
- int declarationEnd = constantDeclaration.getStartPosition() + compilUnit.getExtendedLength(constantDeclaration) - 1;
- int commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- assumeEquals("Enum constant declaration "+constantDeclaration+" does not have the correct length", commentEnd, declarationEnd);
-
- // Verify extension of second enum declaration constant
- comment = (Comment) unitComments.get(1);
- constantDeclaration = (EnumConstantDeclaration) enumDeclaration.enumConstants().get(1);
- declarationEnd = constantDeclaration.getStartPosition() + compilUnit.getExtendedLength(constantDeclaration) - 1;
- commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- assumeEquals("Enum constant declaration "+constantDeclaration+" does not have the correct length", commentEnd, declarationEnd);
-
- // Verify extension of first field declaration
- comment = (Comment) unitComments.get(2);
- FieldDeclaration fieldDeclaration = (FieldDeclaration) enumDeclaration.bodyDeclarations().get(1);
- declarationEnd = fieldDeclaration.getStartPosition() + compilUnit.getExtendedLength(fieldDeclaration) - 1;
- commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- assumeEquals("Enum constant declaration "+constantDeclaration+" does not have the correct length", commentEnd, declarationEnd);
-
- // Verify extension of second field declaration
- comment = (Comment) unitComments.get(3);
- fieldDeclaration = (FieldDeclaration) enumDeclaration.bodyDeclarations().get(2);
- declarationEnd = fieldDeclaration.getStartPosition() + compilUnit.getExtendedLength(fieldDeclaration) - 1;
- commentEnd = comment.getStartPosition() + comment.getLength() - 1;
- assumeEquals("Enum constant declaration "+constantDeclaration+" does not have the correct length", commentEnd, declarationEnd);
- }
- }
}
Oops, something went wrong.

0 comments on commit 6506510

Please sign in to comment.