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 30216 Details for
Bug 117018
IVariableBinding#getConstantValue() could be lazy resolved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
117018_org.eclipse.jdt.core.tests.model.txt (text/plain), 2.29 KB, created by
Jerome Lanneluc
on 2005-11-18 07:13:54 EST
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-11-18 07:13:54 EST
Size:
2.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java,v >retrieving revision 1.59 >diff -u -r1.59 BatchASTCreationTests.java >--- src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java 18 Nov 2005 11:56:10 -0000 1.59 >+++ src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java 18 Nov 2005 12:14:07 -0000 >@@ -91,7 +91,7 @@ > // All specified tests which do not belong to the class are skipped... > static { > // TESTS_PREFIX = "testBug86380"; >-// TESTS_NAMES = new String[] { "test070" }; >+ TESTS_NAMES = new String[] { "test071" }; > // TESTS_NUMBERS = new int[] { 83230 }; > // TESTS_RANGE = new int[] { 83304, -1 }; > } >@@ -1595,4 +1595,37 @@ > // ensure that the fields for Y are not resolved > assertBindingsEqual("", yBinding.getDeclaredFields()); > } >+ >+ /* >+ * Ensures that unrequested compilation units are not resolved >+ * (regression test for bug 117018 IVariableBinding#getConstantValue() could be lazy resolved) >+ */ >+ public void test071() throws CoreException { >+ final MarkerInfo[] markerInfos = createMarkerInfos(new String[] { >+ "/P/p1/X.java", >+ "package p1;\n" + >+ "public class X extends /*start*/Y/*end*/ {\n" + >+ "}", >+ "/P/p1/Y.java", >+ "package p1;\n" + >+ "public class Y {\n" + >+ " static final int CONST = 2 + 3;\n" + >+ "}", >+ }); >+ this.workingCopies = createWorkingCopies(markerInfos, this.owner); >+ class Requestor extends TestASTRequestor { >+ Object constantValue = null; >+ public void acceptAST(ICompilationUnit source, CompilationUnit ast) { >+ super.acceptAST(source, ast); >+ Type y = (Type) findNode(ast, markerInfos[0]); >+ ITypeBinding typeBinding = y.resolveBinding(); >+ IVariableBinding fieldBinding = typeBinding.getDeclaredFields()[0]; >+ this.constantValue = fieldBinding.getConstantValue(); >+ } >+ } >+ Requestor requestor = new Requestor(); >+ resolveASTs(new ICompilationUnit[] {this.workingCopies[0]}, requestor); >+ >+ assertEquals("Unexpected constant value", new Integer(5), requestor.constantValue); >+ } > }
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 117018
:
30215
| 30216 |
30221