| Summary: | [DOM] ASTParser.setEnvironment() ignores includeRunningVMBootclasspath parameter | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Tom Ball <tball> | ||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | curtis.windatt.public, daniel_megert, Olivier_Thomann, srikanth_sankaran | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Srikanth, this looks too late for RC4. Targeting 3.7.1 ? Created attachment 196804 [details]
Proposed fix
(In reply to comment #2) > Created attachment 196804 [details] > Proposed fix Wow, that was fast triage! Thanks. FWIW, I have an ugly workaround, so there's no rush: Field field = parser.getClass().getDeclaredField("bits"); field.setAccessible(true); int bits = field.getInt(parser); // Turn off CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH bits &= ~0x20; field.setInt(parser, bits); > FWIW, I have an ugly workaround, so there's no rush:
>
> Field field = parser.getClass().getDeclaredField("bits");
> field.setAccessible(true);
> int bits = field.getInt(parser);
> // Turn off CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH
> bits &= ~0x20;
> field.setInt(parser, bits);
This is exactly why I'd like to get it fixed asap :-).
Fix is trivial and there is no risk, but the rules are pretty strict at this point.
Daniel, what is your take on this one ?
(In reply to comment #4) > > FWIW, I have an ugly workaround, so there's no rush: > > > > Field field = parser.getClass().getDeclaredField("bits"); > > field.setAccessible(true); > > int bits = field.getInt(parser); > > // Turn off CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH > > bits &= ~0x20; > > field.setInt(parser, bits); > This is exactly why I'd like to get it fixed asap :-). > Fix is trivial and there is no risk, but the rules are pretty strict at this > point. > Daniel, what is your take on this one ? Is it a regression compared to 3.6? If not -> 3.7.1. Released in BETA_JAVA7 branch. Since this branch will be our 3.7.1 contents, this is fine. Verified. The fix in the BETA_JAVA7 brach is simple and correct. |
Build Identifier: M20110210-1200 ASTParser.setEnvironment() has a includeRunningVMBootclasspath parameter so the running VM's bootclasspath isn't used when parsing. However, this parameter isn't referenced, and instead this always runs: this.bits |= CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH; Suggested patch: if (includeRunningVMBootclasspath) { this.bits |= CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH; } Reproducible: Always Steps to Reproduce: Open org.eclipse.jdt.core.dom.ASTParser, and code-review its setEnvironment method.