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

Bug 1633

Summary: Scrapbook imports
Product: [Eclipse Project] JDT Reporter: Nick Edgar <n.a.edgar>
Component: DebugAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: darin.eclipse, dirk_baeumer, eclipse
Version: 2.0   
Target Milestone: 2.0 M5   
Hardware: All   
OS: Windows 2000   
Whiteboard:
Bug Depends on: 1546    
Bug Blocks:    

Description Nick Edgar CLA 2001-10-10 22:16:38 EDT
- new Java Project
- new Scrapbook page
- use toolbar package button to have it run in java.util
- evaluate: new Hashtable()
- you get: An exception occurred during evaluation: java.lang.SecurityException

NOTES:

NE (6/12/01 11:14:23 AM)
	I noticed that it put a java.util package in my project.
	I guess the VM doesn't let you shadow JDK packages.

EG (6/12/2001 5:18:04 AM)
	this has worked in the old evaluation support.
EG (6/12/2001 5:14:57 AM)
	this has worked in the past. 
	Run in works for application packages, e.g., I can do run in "junit.text.ui" 
	and evaluate new TestRunner().
	Suggest README
	Moving to DUI

JGS (6/12/01 10:38:06 AM)
	Can duplicate under 122.  This problem was originally filed as 1GEWPXV: ITPDUI:ALL - SecurityException running in package
	but was closed because it couldn't be duplicated under 119.  It appears to be back with 122.

DW (6/12/01 12:29:00 PM)
	Problem does not occur with Sun JDK 1.2.2 or J9.
	README.

DW (6/15/01 10:12:57 AM)
	Added to README.
Comment 1 DJ Houghton CLA 2001-10-24 06:37:00 EDT
PRODUCT VERSION:
122 JDK

Comment 2 Darin Wright CLA 2002-01-14 18:05:35 EST
Requires AST evaluation
Comment 3 Darin Wright CLA 2002-01-23 15:36:12 EST
*** Bug 8282 has been marked as a duplicate of this bug. ***
Comment 4 Darin Wright CLA 2002-02-26 14:47:52 EST
Suggest to remove "run in package", and replace with "imports"
Comment 5 Darin Wright CLA 2002-03-18 15:23:09 EST
"Run in" to be replaced with "Select imports" (a multi-selection dialog). Use 
dialog instead of writing in source code, as Snippet parser does not support 
import parsing.
Comment 6 Darin Wright CLA 2002-03-18 15:23:51 EST
*** Bug 1526 has been marked as a duplicate of this bug. ***
Comment 7 Darin Swanson CLA 2002-03-22 18:38:15 EST
Released initial implementation to head.
Comment 8 Darin Swanson CLA 2002-03-25 10:37:42 EST
Implemented in JavaSnippetEditor, SelectImportsAction and SelectImportDialog.
Comment 9 Darin Swanson CLA 2002-03-25 10:38:04 EST
Please verify (Darin W)
Comment 10 Darin Wright CLA 2002-03-25 12:23:01 EST
Got an NPE verifying - created a new snippet page in the root of JUnit project, 
pressed imports button:

java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.debug.ui.snippeteditor.SelectImportsDialog$ImportsConte
ntProvider.populateFilters(SelectImportsDialog.java:120)
	at 
org.eclipse.jdt.internal.debug.ui.snippeteditor.SelectImportsDialog$ImportsConte
ntProvider.<init>(SelectImportsDialog.java:115)
	at 
org.eclipse.jdt.internal.debug.ui.snippeteditor.SelectImportsDialog.createDialog
Area(SelectImportsDialog.java:364)
	at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:465)
	at org.eclipse.jface.window.Window.create(Window.java:263)
	at org.eclipse.jface.window.Window.open(Window.java:512)
	at 
org.eclipse.jdt.internal.debug.ui.snippeteditor.SelectImportsAction.chooseImport
s(SelectImportsAction.java:36)
	at 
org.eclipse.jdt.internal.debug.ui.snippeteditor.SelectImportsAction.run
(SelectImportsAction.java:30)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1420)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:722)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:705)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:777)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:14)
Comment 11 Darin Wright CLA 2002-03-25 12:23:21 EST
Re-opened for NPE
Comment 12 Darin Swanson CLA 2002-03-25 12:54:45 EST
Sorry about that...fixed in ImportsContentProvider.
Please verify.
Comment 13 Darin Swanson CLA 2002-03-25 12:55:04 EST
Verify (Darin W again).
Comment 14 Darin Wright CLA 2002-03-26 09:16:18 EST
Verified.