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 67495 Details for
Bug 187329
compilation error constants created with static methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 3.26 KB, created by
Kent Johnson
on 2007-05-16 15:29:16 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2007-05-16 15:29:16 EDT
Size:
3.26 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java,v >retrieving revision 1.55 >diff -u -r1.55 StaticImportTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java 20 Nov 2006 14:17:13 -0000 1.55 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/StaticImportTest.java 16 May 2007 19:28:07 -0000 >@@ -1872,4 +1872,30 @@ > "The local variable i may not have been initialized\n" + > "----------\n"); > } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=187329 >+ public void test050() { >+ this.runConformTest( >+ new String[] { >+ "p/A.java", >+ "package p;\n" + >+ "import static p.B.bar3;\n" + >+ "public class A { int a = bar3; }" , >+ "p/B.java", >+ "package p;\n" + >+ "import static p.Util.someStaticMethod;\n" + >+ "public class B {\n" + >+ " static final int bar = someStaticMethod();\n" + >+ " static final int bar2 = someStaticMethod();\n" + >+ " static final int bar3 = someStaticMethod();\n" + >+ "}" , >+ "p/C.java", >+ "package p;\n" + >+ "import static p.B.bar;\n" + >+ "public class C { int c = bar; }" , >+ "p/Util.java", >+ "package p;\n" + >+ "class Util { static int someStaticMethod() { return 0; } }" >+ }, >+ ""); >+ } > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java,v >retrieving revision 1.108 >diff -u -r1.108 CompilationUnitScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 27 Apr 2007 15:51:38 -0000 1.108 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 16 May 2007 19:28:08 -0000 >@@ -293,6 +293,9 @@ > if (referenceContext.imports == null) { > this.typeOrPackageCache = new HashtableOfObject(1); > return; >+ } else if (this.typeOrPackageCache != null) { >+ // can be called when a field constant is resolved before static imports >+ return; > } > > // collect the top level type names if a single type import exists >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.306 >diff -u -r1.306 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 14 May 2007 16:47:46 -0000 1.306 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 16 May 2007 19:28:08 -0000 >@@ -1877,6 +1877,7 @@ > > // at this point the scope is a compilation unit scope & need to check for imported static methods > CompilationUnitScope unitScope = (CompilationUnitScope) scope; >+ unitScope.faultInImports(); // field constants can cause static imports to be accessed before they're resolved > ImportBinding[] imports = unitScope.imports; > if (imports != null) { > ObjectVector visible = null;
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 187329
:
67466
| 67495 |
67500