Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 424653

Summary: [Scrapbook] current project not included by default causes "cannot be resolved to a type" error
Product: [Eclipse Project] JDT Reporter: Cliff B <cliffb>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: cliffb
Version: 4.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Cliff B CLA 2013-12-25 19:54:39 EST
When a scrapbook page is created and a class from the same project is referenced, it results in a "_____ cannot be resolved to a type" error. 

Can be duplicated by following the first three Total Beginner tutorials.

Does not seem to matter which folder the scrapbook page is created in. Will even happen if the scrapbook page is created in the same package as the classes referenced.

One workaround is to right-click on scrapbook page, select "set imports", and then add the current package using the Java Snippets Imports window.

Another workaround is to explicitly name the class, i.e. org.totalbeginner.tutorial.Person() instead of just Person().

I believe that the current project should be included by default no that neither workaround is required. I believe it worked this way in Juno.

Environment:
Java 7 update 45
Eclipse 4.3.1
Windows 7 with current updates as of 12/24/13

This was duplicated on two different computers to verify that it wasn't unique to any one computer.

If more information is needed, please email the author.
Comment 1 Eclipse Genie CLA 2020-03-29 11:34:39 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.