Bug 14892 - Failed package import leads to OutOfMemory errors at compile time
Summary: Failed package import leads to OutOfMemory errors at compile time
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-30 05:01 EDT by Lars Wunderlich CLA
Modified: 2002-06-03 10:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wunderlich CLA 2002-04-30 05:01:35 EDT
I'm using Eclipse 20020425 with Windows NT.
For example I've got number of Javafiles in a D-partition directory named 
D:\test. If one of those Javafiles is testA.java and has an Java-package 
description "package myjava;" Eclipse can't match the correct package 
description inside the java file for generating a directory "myjava" and uses 
the D:\test directory to import java files.
Normally this means that the compiler is unable to compile the file cause of 
the misleading package reference.
In this case I tried to rename the package so that it matches the package 
description of the original Java files. 
But because there is a big number of Java files the compiler got an OutOfMemory 
error show a warning message window (see exceptions at end of bug report).
I would prefer to generate the original package structure (like in VisualAge) 
from the package statement in the original java or class file (feature request).

Additionally I've seen that in some cases Eclipse than starts to delete 
original Java files in Workspace if it's unable to cope with an outofmemory 
error (bug report concerning this topic).


---------------------------------------------------------

!ENTRY org.eclipse.jdt.ui 4 1 Tue Apr 30 09:39:18 CEST 2002
!MESSAGE Internal Error
!STACK java.lang.reflect.InvocationTargetException: java.lang.OutOfMemoryError
	<<no stack trace available>>
!ENTRY org.eclipse.jdt.ui 4 1 Tue Apr 30 09:45:39 CEST 2002
!MESSAGE Internal Error
!STACK java.lang.reflect.InvocationTargetException: java.lang.OutOfMemoryError
	<<no stack trace available>>
!ENTRY org.eclipse.jdt.ui 4 1 Tue Apr 30 09:46:20 CEST 2002
!MESSAGE Internal Error
!STACK Java Model Exception: Java Model Status [jintegra.msoffice97.word does 
not exist.]
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException
(JavaElement.java:476)
	at org.eclipse.jdt.internal.core.PackageFragment.getUnderlyingResource
(PackageFragment.java:241)
	at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource
(Openable.java:216)
	at 
org.eclipse.jdt.internal.core.CompilationUnit.getCorrespondingResource
(CompilationUnit.java:393)
	at org.eclipse.jdt.internal.core.Openable.openWhenClosed
(Openable.java:373)
	at org.eclipse.jdt.internal.core.JavaElement.openHierarchy
(JavaElement.java:497)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java:287)
	at org.eclipse.jdt.internal.core.JavaElement.getChildren
(JavaElement.java:244)
	at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType
(JavaElement.java:253)
	at org.eclipse.jdt.internal.core.CompilationUnit.getTypes
(CompilationUnit.java:551)
	at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.getCandidates
(OpenTypeHierarchyUtil.java:232)
	at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.getCandidates
(OpenTypeHierarchyAction.java:86)
	at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.selectionChanged
(OpenTypeHierarchyAction.java:80)
	at 
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged
(SelectionDispatchAction.java:122)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged
(SelectionDispatchAction.java:101)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged
(Viewer.java:147)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection
(StructuredViewer.java:1064)
	at org.eclipse.jface.viewers.StructuredViewer.handleSelect
(StructuredViewer.java:510)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.widgetSelected
(AbstractTreeViewer.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent
(TypedListener.java:85)
	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:1412)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:816)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:643)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:160)
	at org.eclipse.core.launcher.Main.run(Main.java:548)
	at org.eclipse.core.launcher.Main.main(Main.java:403)
Comment 1 Philipe Mulet CLA 2002-05-01 07:58:16 EDT
How much RAM do you have, and what settings are you using for the java VM 
running Eclipse (if not using default eclipse.exe). What JDK are you using ?

Comment 2 Philipe Mulet CLA 2002-05-03 03:15:54 EDT
Unclear this has anything to do with JDT/Core since no stack trace is available 
for the OutOfMemoryError.

Unless some more information is added to this report, we will have to close it.
Comment 3 Philipe Mulet CLA 2002-05-27 06:00:18 EDT
Closing, please reopen if you have more information. As far as the JavaModel 
exception is involved, we isolated a couple scenarii where the model could be 
incorrectly populated, leading to some of these to be fired.

Past an out of memory failure, however nothing may work...
Comment 4 Philipe Mulet CLA 2002-05-27 06:02:39 EDT
Jerome - can you give it a try ?
Comment 5 Jerome Lanneluc CLA 2002-05-27 06:50:55 EDT
Could not reproduce in F1. Please reopen if you have steps to reproduce the 
problem.
Comment 6 Jerome Lanneluc CLA 2002-05-27 06:51:29 EDT
Sorry, I meant to close as WORKSFORME.
Comment 7 Jerome Lanneluc CLA 2002-05-27 06:51:47 EDT
Closing.
Comment 8 Philipe Mulet CLA 2002-06-03 10:29:39 EDT
Verified on a large package rename with 256MB ram.