Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 73984 Details for
Bug 186114
IMethodBinding.overrides(..) should consider static
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression tests
patch_186114_tests.txt (text/plain), 6.23 KB, created by
Olivier Thomann
on 2007-07-17 13:52:03 EDT
(
hide
)
Description:
Regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-07-17 13:52:03 EDT
Size:
6.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.249 >diff -u -r1.249 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 5 Jul 2007 13:52:42 -0000 1.249 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 17 Jul 2007 17:51:20 -0000 >@@ -46,8 +46,8 @@ > } > > static { >-// TESTS_NUMBERS = new int[] { 276 }; >-// TESTS_RANGE = new int[] { 253, -1 }; >+// TESTS_NUMBERS = new int[] { 277 }; >+// TESTS_RANGE = new int[] { 277, -1 }; > // TESTS_NAMES = new String[] {"test0204"}; > } > public static Test suite() { >@@ -9195,5 +9195,131 @@ > parser.setProject(this.getJavaProject("Converter15")); > parser.setKind(ASTParser.K_COMPILATION_UNIT); > parser.createASTs(new ICompilationUnit[]{this.workingCopy}, new String[0], requestor, null); >- } >+ } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=191908 >+ public void test0277() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public static void method() {\n" + >+ " }\n" + >+ "}\n" + >+ "class Y extends X {\n" + >+ " public static void method() {\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ true); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 0); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding1 = methodDeclaration.resolveBinding(); >+ >+ node = getASTNode(unit, 1, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding2 = methodDeclaration.resolveBinding(); >+ >+ assertFalse("Overrides", methodBinding2.overrides(methodBinding1)); >+ } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=191908 >+ public void test0278() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public void method() {\n" + >+ " }\n" + >+ "}\n" + >+ "class Y extends X {\n" + >+ " public static void method() {\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 1, "This static method cannot hide the instance method from X"); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding1 = methodDeclaration.resolveBinding(); >+ >+ node = getASTNode(unit, 1, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding2 = methodDeclaration.resolveBinding(); >+ >+ assertFalse("Overrides", methodBinding2.overrides(methodBinding1)); >+ } >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=191908 >+ public void test0279() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public static void method() {\n" + >+ " }\n" + >+ "}\n" + >+ "class Y extends X {\n" + >+ " public void method() {\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 1, "This instance method cannot override the static method from X"); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding1 = methodDeclaration.resolveBinding(); >+ >+ node = getASTNode(unit, 1, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding2 = methodDeclaration.resolveBinding(); >+ >+ assertFalse("Overrides", methodBinding2.overrides(methodBinding1)); >+ } >+ >+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=191908 >+ public void test0280() throws JavaModelException { >+ this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); >+ String contents = >+ "public class X {\n" + >+ " public void method() {\n" + >+ " }\n" + >+ "}\n" + >+ "class Y extends X {\n" + >+ " @Override\n" + >+ " public void method() {\n" + >+ " }\n" + >+ "}"; >+ ASTNode node = buildAST( >+ contents, >+ this.workingCopy, >+ true); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 0); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ MethodDeclaration methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding1 = methodDeclaration.resolveBinding(); >+ >+ node = getASTNode(unit, 1, 0); >+ assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); >+ methodDeclaration = (MethodDeclaration) node; >+ IMethodBinding methodBinding2 = methodDeclaration.resolveBinding(); >+ >+ assertTrue("Doesn't overrides", methodBinding2.overrides(methodBinding1)); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 186114
:
73983
| 73984